feat: edit an existing custom type
This commit is contained in:
1 parent
083cc9e23e
commit
8e344b2500
57 files changed
+5648
-425
No files matched your search
@@ -164,30 +164,36 @@ describe('Nuxt UI shell foundation and router guards', () => {
|
||||
expect(resolved.meta.title).toBe('Schema')
|
||||
})
|
||||
|
||||
it('The schema type route redirects an unverified session to the pending page', async () => {
|
||||
const getMe = vi.fn().mockResolvedValue({ verified: false })
|
||||
vi.mocked(useApi).mockReturnValue({ getMe })
|
||||
setUpSession()
|
||||
it.each(['articles', 'events'])(
|
||||
'The schema type route redirects an unverified session on /schema/%s to the pending page',
|
||||
async (key) => {
|
||||
const getMe = vi.fn().mockResolvedValue({ verified: false })
|
||||
vi.mocked(useApi).mockReturnValue({ getMe })
|
||||
setUpSession()
|
||||
|
||||
await router.push('/schema/articles')
|
||||
mountApp()
|
||||
await router.push(`/schema/${key}`)
|
||||
mountApp()
|
||||
|
||||
await vi.waitFor(() => expect(router.currentRoute.value.path).toBe('/register/pending'))
|
||||
})
|
||||
await vi.waitFor(() => expect(router.currentRoute.value.path).toBe('/register/pending'))
|
||||
},
|
||||
)
|
||||
|
||||
it('The schema type route redirects a signed-out visitor to login with the original path', async () => {
|
||||
const getMe = vi.fn().mockRejectedValue(new ApiError(401))
|
||||
vi.mocked(useApi).mockReturnValue({ getMe })
|
||||
setUpSession()
|
||||
it.each(['articles', 'events'])(
|
||||
'The schema type route redirects a signed-out visitor on /schema/%s to login with the original path',
|
||||
async (key) => {
|
||||
const getMe = vi.fn().mockRejectedValue(new ApiError(401))
|
||||
vi.mocked(useApi).mockReturnValue({ getMe })
|
||||
setUpSession()
|
||||
|
||||
await router.push('/schema/articles')
|
||||
mountApp()
|
||||
await flushPromises()
|
||||
await router.push(`/schema/${key}`)
|
||||
mountApp()
|
||||
await flushPromises()
|
||||
|
||||
expect(router.currentRoute.value.fullPath).toBe(
|
||||
'/login?redirect=/schema/articles&reason=expired',
|
||||
)
|
||||
})
|
||||
expect(router.currentRoute.value.fullPath).toBe(
|
||||
`/login?redirect=/schema/${key}&reason=expired`,
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
it('The new content type route is registered before the type key route, verified-only, titled Schema', () => {
|
||||
const resolved = router.resolve('/schema/new')
|
||||
|
||||
Reference in new issue
Block a user