describe('GET /api/v1/gateway/instance/key', () => { it('should get instance keys', async () => { await authenticatedRequest .get('/api/v1/gateway/instance/key') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('rsa_fingerprint'); expect(res.body).to.have.property('ecdsa_fingerprint'); }); }); });
describe('DELETE /api/v1/area/:area_selector', () => { it('should delete a area', async () => { await authenticatedRequest .delete('/api/v1/area/test-area') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('success', true); }); }); });
describe('POST /api/v1/house/:user_selector/user/:user_selector/seen', () => { it('should mark the user has seen in this house', async () => { await authenticatedRequest .post('/api/v1/house/test-house/user/john/seen') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('current_house_id', 'a741dfa6-24de-4b46-afc7-370772f068d5'); }); }); });
describe('POST /api/v1/session/api_key', () => { it('should create api key', async () => { await authenticatedRequest .post('/api/v1/session/api_key') .expect('Content-Type', /json/) .expect(201) .then((res) => { expect(res.body).to.have.property('api_key'); expect(res.body).to.have.property('session_id'); }); }); });
describe('GET /api/v1/gateway/backup/restore/status', () => { it('should get restore status', async () => { await authenticatedRequest .get('/api/v1/gateway/backup/restore/status') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('restore_in_progress'); }); }); });
describe('GET /api/v1/gateway/status', () => { it('should get gateway status', async () => { await authenticatedRequest .get('/api/v1/gateway/status') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('connected'); expect(res.body).to.have.property('configured'); }); }); });
describe('DELETE /api/v1/house/test-house', () => { it('should delete a house', async () => { await authenticatedRequest .delete('/api/v1/house/test-house') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('success', true); }); }); });
describe('DELETE /api/v1/room/:room_selector', () => { it('should delete a room', async () => { await authenticatedRequest .delete('/api/v1/room/test-room') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('success', true); }); }); });
describe('GET /api/v1/scene/:scene_selector', () => { it('should get scene by selector', async () => { await authenticatedRequest .get('/api/v1/scene/test-scene') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('selector', 'test-scene'); }); }); });
describe('GET /api/v1/setup', () => { it('should return if the account is confifured or not', async () => { await request .get('/api/v1/setup') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('account_configured', true); }); }); });
describe('DELETE /api/v1/calendar/:calendar_selector', () => { it('should delete a calendar', async () => { await authenticatedRequest .delete('/api/v1/calendar/test-calendar') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('success', true); }); }); });
describe('DELETE /api/v1/device/:device_selector', () => { it('should delete device', async () => { await authenticatedRequest .delete('/api/v1/device/test-device') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('success', true); }); }); });
describe('GET /api/v1/system/info', () => { it('should return system infos', async () => { await authenticatedRequest .get('/api/v1/system/info') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('platform'); expect(res.body).to.have.property('nodejs_version'); }); }); });
describe('DELETE /api/v1/calendar/event/:calendar_event_selector', () => { it('should delete a calendar event', async () => { await authenticatedRequest .delete('/api/v1/calendar/event/test-calendar-event') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('success', true); }); }); });
describe('GET /api/v1/service/:service_name', () => { it('should get a service by name', async () => { await authenticatedRequest .get('/api/v1/service/test-service') .expect('Content-Type', /json/) .expect(200) .then((res) => { expect(res.body).to.have.property('name', 'test-service'); }); }); });