aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/api
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/api')
-rw-r--r--tests/functional/api/static/announcements.spec.ts26
-rw-r--r--tests/functional/api/static/features.spec.ts24
-rw-r--r--tests/functional/api/static/news.spec.ts14
-rw-r--r--tests/functional/api/static/services.spec.ts14
4 files changed, 40 insertions, 38 deletions
diff --git a/tests/functional/api/static/announcements.spec.ts b/tests/functional/api/static/announcements.spec.ts
index 45881ec..8a74ca7 100644
--- a/tests/functional/api/static/announcements.spec.ts
+++ b/tests/functional/api/static/announcements.spec.ts
@@ -1,20 +1,22 @@
1import { test } from '@japa/runner' 1import { test } from '@japa/runner';
2import { apiVersion } from '../../../config.js' 2import { apiVersion } from '../../../config.js';
3 3
4test.group('API / Static / News', () => { 4test.group('API / Static / News', () => {
5 test('returns a 404 response when the requested versions does not exist', async ({ client }) => { 5 test('returns a 404 response when the requested versions does not exist', async ({
6 const response = await client.get(`/${apiVersion}/announcements/illegal`) 6 client,
7 }) => {
8 const response = await client.get(`/${apiVersion}/announcements/illegal`);
7 9
8 response.assertStatus(404) 10 response.assertStatus(404);
9 response.assertTextIncludes('No announcement found.') 11 response.assertTextIncludes('No announcement found.');
10 }) 12 });
11 13
12 test('returns a 200 response with default version file when specifying version as input', async ({ 14 test('returns a 200 response with default version file when specifying version as input', async ({
13 client, 15 client,
14 }) => { 16 }) => {
15 const response = await client.get(`/${apiVersion}/announcements/version`) 17 const response = await client.get(`/${apiVersion}/announcements/version`);
16 18
17 response.assertStatus(200) 19 response.assertStatus(200);
18 response.assertBody({ 20 response.assertBody({
19 main: { 21 main: {
20 headline: 'Example Announcement', 22 headline: 'Example Announcement',
@@ -48,6 +50,6 @@ test.group('API / Static / News', () => {
48 }, 50 },
49 }, 51 },
50 }, 52 },
51 }) 53 });
52 }) 54 });
53}) 55});
diff --git a/tests/functional/api/static/features.spec.ts b/tests/functional/api/static/features.spec.ts
index c31e25f..a7a1e09 100644
--- a/tests/functional/api/static/features.spec.ts
+++ b/tests/functional/api/static/features.spec.ts
@@ -1,5 +1,5 @@
1import { test } from '@japa/runner' 1import { test } from '@japa/runner';
2import { apiVersion } from '../../../config.js' 2import { apiVersion } from '../../../config.js';
3 3
4const defaultResponse = { 4const defaultResponse = {
5 isServiceProxyEnabled: true, 5 isServiceProxyEnabled: true,
@@ -8,22 +8,22 @@ const defaultResponse = {
8 isSettingsWSEnabled: false, 8 isSettingsWSEnabled: false,
9 isMagicBarEnabled: true, 9 isMagicBarEnabled: true,
10 isTodosEnabled: true, 10 isTodosEnabled: true,
11} 11};
12 12
13test.group('API / Static / Features', () => { 13test.group('API / Static / Features', () => {
14 test('returns a 200 response with empty array', async ({ client }) => { 14 test('returns a 200 response with empty array', async ({ client }) => {
15 const response = await client.get(`/${apiVersion}/features`) 15 const response = await client.get(`/${apiVersion}/features`);
16 16
17 response.assertStatus(200) 17 response.assertStatus(200);
18 response.assertBody(defaultResponse) 18 response.assertBody(defaultResponse);
19 }) 19 });
20 20
21 test('returns a 200 response with expected object when calling with :mode', async ({ 21 test('returns a 200 response with expected object when calling with :mode', async ({
22 client, 22 client,
23 }) => { 23 }) => {
24 const response = await client.get(`/${apiVersion}/features/random`) 24 const response = await client.get(`/${apiVersion}/features/random`);
25 25
26 response.assertStatus(200) 26 response.assertStatus(200);
27 response.assertBody(defaultResponse) 27 response.assertBody(defaultResponse);
28 }) 28 });
29}) 29});
diff --git a/tests/functional/api/static/news.spec.ts b/tests/functional/api/static/news.spec.ts
index 71b5797..28ca64e 100644
--- a/tests/functional/api/static/news.spec.ts
+++ b/tests/functional/api/static/news.spec.ts
@@ -1,11 +1,11 @@
1import { test } from '@japa/runner' 1import { test } from '@japa/runner';
2import { apiVersion } from '../../../config.js' 2import { apiVersion } from '../../../config.js';
3 3
4test.group('API / Static / News', () => { 4test.group('API / Static / News', () => {
5 test('returns a 200 response with empty array', async ({ client }) => { 5 test('returns a 200 response with empty array', async ({ client }) => {
6 const response = await client.get(`/${apiVersion}/news`) 6 const response = await client.get(`/${apiVersion}/news`);
7 7
8 response.assertStatus(200) 8 response.assertStatus(200);
9 response.assertBody([]) 9 response.assertBody([]);
10 }) 10 });
11}) 11});
diff --git a/tests/functional/api/static/services.spec.ts b/tests/functional/api/static/services.spec.ts
index 595b8dc..109757e 100644
--- a/tests/functional/api/static/services.spec.ts
+++ b/tests/functional/api/static/services.spec.ts
@@ -1,11 +1,11 @@
1import { test } from '@japa/runner' 1import { test } from '@japa/runner';
2import { apiVersion } from '../../../config.js' 2import { apiVersion } from '../../../config.js';
3 3
4test.group('API / Static / Services', () => { 4test.group('API / Static / Services', () => {
5 test('returns a 200 response with empty array', async ({ client }) => { 5 test('returns a 200 response with empty array', async ({ client }) => {
6 const response = await client.get(`/${apiVersion}/services`) 6 const response = await client.get(`/${apiVersion}/services`);
7 7
8 response.assertStatus(200) 8 response.assertStatus(200);
9 response.assertBody([]) 9 response.assertBody([]);
10 }) 10 });
11}) 11});