vuestic-admin.spec.ts
1.45 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { test } from '@playwright/test'
import { testApiMocksPage } from '../utils'
import { getProjectsStub, getUsersStub } from '../stubs'
const pageMocks: {
name: string
url: string
apiMocks?: Record<string, object>
}[] = [
{
name: 'Dashboard',
url: '/dashboard',
},
{
name: 'Settings',
url: '/settings',
},
{
name: 'Preferences',
url: '/preferences',
},
{
name: 'Users',
url: '/users',
apiMocks: {
'/projects': getProjectsStub,
'/users': getUsersStub,
},
},
{
name: 'Projects',
url: '/projects',
apiMocks: {
'/projects': getProjectsStub,
'/users': getUsersStub,
},
},
{
name: 'Payments',
url: '/payments',
},
{
name: 'Payment Methods',
url: '/payments/payment-methods',
},
{
name: 'Billing',
url: '/payments/billing',
},
{
name: 'Pricing Plans',
url: '/payments/pricing-plans',
},
{
name: 'FAQ',
url: '/faq',
},
{
name: 'Auth',
url: '/auth',
},
{
name: 'Login',
url: '/auth/login',
},
{
name: 'Sign Up',
url: '/auth/signup',
},
{
name: 'Recover Password',
url: '/auth/recover-password',
},
{
name: 'Recover Password Email',
url: '/auth/recover-password-email',
},
{
name: '404',
url: '/404',
},
]
for (const item of pageMocks) {
test(item.name, async ({ page }) => {
await testApiMocksPage({
page,
...item,
})
})
}