diff options
author | 2024-02-10 18:37:40 -0700 | |
---|---|---|
committer | 2024-02-13 06:59:44 +0530 | |
commit | e1c47572a6235fd8fd20af888ac3a11c7ae1369d (patch) | |
tree | 2dccff36a441916d7014037cef3f7ce84a790cad /tests/functional/api/static/announcements.spec.ts | |
parent | refactor: project maintenance (diff) | |
download | ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.gz ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.zst ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.zip |
updates
Diffstat (limited to 'tests/functional/api/static/announcements.spec.ts')
-rw-r--r-- | tests/functional/api/static/announcements.spec.ts | 26 |
1 files changed, 14 insertions, 12 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 @@ | |||
1 | import { test } from '@japa/runner' | 1 | import { test } from '@japa/runner'; |
2 | import { apiVersion } from '../../../config.js' | 2 | import { apiVersion } from '../../../config.js'; |
3 | 3 | ||
4 | test.group('API / Static / News', () => { | 4 | test.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 | }); |