aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/api/static/features.spec.ts
blob: c31e25f7729703a0897b6807a2ca6bca55119a7e (plain) (blame)
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
import { test } from '@japa/runner'
import { apiVersion } from '../../../config.js'

const defaultResponse = {
  isServiceProxyEnabled: true,
  isWorkspaceEnabled: true,
  isAnnouncementsEnabled: true,
  isSettingsWSEnabled: false,
  isMagicBarEnabled: true,
  isTodosEnabled: true,
}

test.group('API / Static / Features', () => {
  test('returns a 200 response with empty array', async ({ client }) => {
    const response = await client.get(`/${apiVersion}/features`)

    response.assertStatus(200)
    response.assertBody(defaultResponse)
  })

  test('returns a 200 response with expected object when calling with :mode', async ({
    client,
  }) => {
    const response = await client.get(`/${apiVersion}/features/random`)

    response.assertStatus(200)
    response.assertBody(defaultResponse)
  })
})