diff options
author | 2024-02-10 18:19:14 -0700 | |
---|---|---|
committer | 2024-02-13 06:59:44 +0530 | |
commit | 7584d2d7a7110aef0331ebfa178b2295842c59fa (patch) | |
tree | 900cd71237e6231b57936fcce77ff229cd459041 /tests/functional/dashboard/disabled-dashboard.spec.ts | |
parent | upgrade recipes submodule (diff) | |
download | ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.gz ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.zst ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.zip |
refactor: project maintenance
- work in progress
Diffstat (limited to 'tests/functional/dashboard/disabled-dashboard.spec.ts')
-rw-r--r-- | tests/functional/dashboard/disabled-dashboard.spec.ts | 82 |
1 files changed, 37 insertions, 45 deletions
diff --git a/tests/functional/dashboard/disabled-dashboard.spec.ts b/tests/functional/dashboard/disabled-dashboard.spec.ts index cc9052c..fd9600f 100644 --- a/tests/functional/dashboard/disabled-dashboard.spec.ts +++ b/tests/functional/dashboard/disabled-dashboard.spec.ts | |||
@@ -1,71 +1,63 @@ | |||
1 | import { test } from '@japa/runner'; | 1 | import { test } from '@japa/runner' |
2 | import Config from '@ioc:Adonis/Core/Config'; | 2 | import Config from '@ioc:Adonis/Core/Config' |
3 | 3 | ||
4 | const disabledDashboardMessage = | 4 | const disabledDashboardMessage = |
5 | 'The user dashboard is disabled on this server\n\nIf you are the server owner, please set IS_DASHBOARD_ENABLED to true to enable the dashboard.'; | 5 | 'The user dashboard is disabled on this server\n\nIf you are the server owner, please set IS_DASHBOARD_ENABLED to true to enable the dashboard.' |
6 | 6 | ||
7 | test.group('Dashboard / Disabled dashboard', group => { | 7 | test.group('Dashboard / Disabled dashboard', (group) => { |
8 | group.setup(() => { | 8 | group.setup(() => { |
9 | Config.set('dashboard.enabled', false); | 9 | Config.set('dashboard.enabled', false) |
10 | }); | 10 | }) |
11 | 11 | ||
12 | group.teardown(() => { | 12 | group.teardown(() => { |
13 | Config.set('dashboard.enabled', true); | 13 | Config.set('dashboard.enabled', true) |
14 | }); | 14 | }) |
15 | 15 | ||
16 | test('Login page returns disabled dashboard message', async ({ client }) => { | 16 | test('Login page returns disabled dashboard message', async ({ client }) => { |
17 | const response = await client.get('/user/login'); | 17 | const response = await client.get('/user/login') |
18 | 18 | ||
19 | response.assertTextIncludes(disabledDashboardMessage); | 19 | response.assertTextIncludes(disabledDashboardMessage) |
20 | }); | 20 | }) |
21 | 21 | ||
22 | test('Forgot password page returns disabled dashboard message', async ({ | 22 | test('Forgot password page returns disabled dashboard message', async ({ client }) => { |
23 | client, | 23 | const response = await client.get('/user/forgot') |
24 | }) => { | ||
25 | const response = await client.get('/user/forgot'); | ||
26 | 24 | ||
27 | response.assertTextIncludes(disabledDashboardMessage); | 25 | response.assertTextIncludes(disabledDashboardMessage) |
28 | }); | 26 | }) |
29 | 27 | ||
30 | test('Reset password page returns disabled dashboard message', async ({ | 28 | test('Reset password page returns disabled dashboard message', async ({ client }) => { |
31 | client, | 29 | const response = await client.get('/user/reset') |
32 | }) => { | ||
33 | const response = await client.get('/user/reset'); | ||
34 | 30 | ||
35 | response.assertTextIncludes(disabledDashboardMessage); | 31 | response.assertTextIncludes(disabledDashboardMessage) |
36 | }); | 32 | }) |
37 | 33 | ||
38 | test('Account page returns disabled dashboard message', async ({ | 34 | test('Account page returns disabled dashboard message', async ({ client }) => { |
39 | client, | 35 | const response = await client.get('/user/account') |
40 | }) => { | ||
41 | const response = await client.get('/user/account'); | ||
42 | 36 | ||
43 | response.assertTextIncludes(disabledDashboardMessage); | 37 | response.assertTextIncludes(disabledDashboardMessage) |
44 | }); | 38 | }) |
45 | 39 | ||
46 | test('Data page returns disabled dashboard message', async ({ client }) => { | 40 | test('Data page returns disabled dashboard message', async ({ client }) => { |
47 | const response = await client.get('/user/data'); | 41 | const response = await client.get('/user/data') |
48 | 42 | ||
49 | response.assertTextIncludes(disabledDashboardMessage); | 43 | response.assertTextIncludes(disabledDashboardMessage) |
50 | }); | 44 | }) |
51 | 45 | ||
52 | test('Export page returns disabled dashboard message', async ({ client }) => { | 46 | test('Export page returns disabled dashboard message', async ({ client }) => { |
53 | const response = await client.get('/user/export'); | 47 | const response = await client.get('/user/export') |
54 | 48 | ||
55 | response.assertTextIncludes(disabledDashboardMessage); | 49 | response.assertTextIncludes(disabledDashboardMessage) |
56 | }); | 50 | }) |
57 | 51 | ||
58 | test('Transfer page returns disabled dashboard message', async ({ | 52 | test('Transfer page returns disabled dashboard message', async ({ client }) => { |
59 | client, | 53 | const response = await client.get('/user/transfer') |
60 | }) => { | ||
61 | const response = await client.get('/user/transfer'); | ||
62 | 54 | ||
63 | response.assertTextIncludes(disabledDashboardMessage); | 55 | response.assertTextIncludes(disabledDashboardMessage) |
64 | }); | 56 | }) |
65 | 57 | ||
66 | test('Logout page returns disabled dashboard message', async ({ client }) => { | 58 | test('Logout page returns disabled dashboard message', async ({ client }) => { |
67 | const response = await client.get('/user/logout'); | 59 | const response = await client.get('/user/logout') |
68 | 60 | ||
69 | response.assertTextIncludes(disabledDashboardMessage); | 61 | response.assertTextIncludes(disabledDashboardMessage) |
70 | }); | 62 | }) |
71 | }); | 63 | }) |