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, 38 insertions, 40 deletions
diff --git a/tests/functional/api/static/announcements.spec.ts b/tests/functional/api/static/announcements.spec.ts
index ac933fe..45881ec 100644
--- a/tests/functional/api/static/announcements.spec.ts
+++ b/tests/functional/api/static/announcements.spec.ts
@@ -1,22 +1,20 @@
1import { test } from '@japa/runner'; 1import { test } from '@japa/runner'
2import { apiVersion } from '../../../config'; 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 ({ 5 test('returns a 404 response when the requested versions does not exist', async ({ client }) => {
6 client, 6 const response = await client.get(`/${apiVersion}/announcements/illegal`)
7 }) => {
8 const response = await client.get(`/${apiVersion}/announcements/illegal`);
9 7
10 response.assertStatus(404); 8 response.assertStatus(404)
11 response.assertTextIncludes('No announcement found.'); 9 response.assertTextIncludes('No announcement found.')
12 }); 10 })
13 11
14 test('returns a 200 response with default version file when specifying version as input', async ({ 12 test('returns a 200 response with default version file when specifying version as input', async ({
15 client, 13 client,
16 }) => { 14 }) => {
17 const response = await client.get(`/${apiVersion}/announcements/version`); 15 const response = await client.get(`/${apiVersion}/announcements/version`)
18 16
19 response.assertStatus(200); 17 response.assertStatus(200)
20 response.assertBody({ 18 response.assertBody({
21 main: { 19 main: {
22 headline: 'Example Announcement', 20 headline: 'Example Announcement',
@@ -50,6 +48,6 @@ test.group('API / Static / News', () => {
50 }, 48 },
51 }, 49 },
52 }, 50 },
53 }); 51 })
54 }); 52 })
55}); 53})
diff --git a/tests/functional/api/static/features.spec.ts b/tests/functional/api/static/features.spec.ts
index 1050fcf..c31e25f 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'; 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 8f3818f..71b5797 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'; 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 55eef37..595b8dc 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'; 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})