listScenes.js 544 B

12345678910111213141516171819
  1. 'use strict'
  2. import test from 'ava'
  3. import request from 'supertest'
  4. import { apiPrefix } from '../../../config'
  5. import { json, getHttpServer } from '../../utils/_test_functions'
  6. // ROUTE /listScenes
  7. // Before each tests, start a server
  8. test.beforeEach(async t => (t.context.server = await getHttpServer()))
  9. test('GET /listScenes', async t => {
  10. const res = await request(t.context.server)
  11. .get(`${apiPrefix}/listScenes`)
  12. t.is(res.status, 200, json(res))
  13. t.deepEqual(res.body.data, ['bathroom', 'contemporary'], json(res.body))
  14. })