Capabilities.test.js
1.17 KB
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').expect
, v3Api = require('../v3').api
, discovery = require('../v3').discovery
, testValues = require('../../test/support/testValues.js')
;
describe('Hue API #capabilities', () => {
let hue;
before(async () => {
const searchResults = await discovery.nupnpSearch();
expect(searchResults).to.have.length.at.least(1);
const localApi = v3Api.createLocal(searchResults[0].ipaddress);
hue = await localApi.connect(testValues.username);
});
describe('#getAll()', () => {
it('should get all capabilities', async () => {
const capabilities = await hue.capabilities.getAll();
expect(capabilities).to.have.property('lights');
expect(capabilities).to.have.property('sensors');
expect(capabilities).to.have.property('groups');
expect(capabilities).to.have.property('scenes');
expect(capabilities).to.have.property('schedules');
expect(capabilities).to.have.property('rules');
expect(capabilities).to.have.property('resourcelinks');
expect(capabilities).to.have.property('streaming');
expect(capabilities.timezones).to.be.instanceOf(Array);
});
});
});