fix(next): properly 404s not found documents (#7833)

This commit is contained in:
Jacob Fletcher
2024-08-23 10:59:03 -04:00
committed by GitHub
parent 0fa6611260
commit 03440f5eca
3 changed files with 19 additions and 1 deletions

View File

@@ -336,6 +336,20 @@ describe('admin1', () => {
})
describe('routing', () => {
test('should 404 not found root pages', async () => {
await page.goto(`${serverURL}/admin/1234`)
const response = await page.waitForResponse((response) => response.status() === 404)
expect(response).toBeTruthy()
await expect(page.locator('.not-found')).toContainText('Nothing found')
})
test('should 404 not found documents', async () => {
await page.goto(`${postsUrl.collection(postsCollectionSlug)}/1234`)
const response = await page.waitForResponse((response) => response.status() === 404)
expect(response).toBeTruthy()
await expect(page.locator('.not-found')).toContainText('Nothing found')
})
test('should use custom logout route', async () => {
await page.goto(`${serverURL}${adminRoutes.routes.admin}${adminRoutes.admin.routes.logout}`)