aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/api/static/features.spec.ts
blob: 1050fcf2801e1157f0046cb142ac6be773cfa5ea (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';

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);
  });
});