-
Notifications
You must be signed in to change notification settings - Fork 8
/
dysonConstants.test.js
40 lines (36 loc) · 1.11 KB
/
dysonConstants.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
const { expect } = require('chai');
const {
getDatapoint,
getNameToDysoncodeTranslation
} = require('./dysonConstants');
describe('dysonConstants', () => {
describe('getDatapoint', () => {
context('given a dyson code', () => {
it('returns the corresponding datapoint', () => {
const datapoint = getDatapoint('fpwr');
expect(datapoint).to.be.an('object');
});
});
context('given a non dyson code', () => {
it('returns undefined', () => {
const datapoint = getDatapoint('MainPower');
expect(datapoint).to.equal(undefined);
});
});
});
describe('getNameToDysoncodeTranslation', () => {
context('given a dyson code', () => {
it('returns undefined', () => {
const datapoint = getNameToDysoncodeTranslation('fpwr');
expect(datapoint).to.equal(undefined);
});
});
context('given a non dyson code', () => {
it('returns the corresponding dyson code', () => {
const datapoint = getNameToDysoncodeTranslation('MainPower');
expect(datapoint).to.be.a('string');
});
});
});
});