test(admin): cover support fallback route and mark todo complete
This commit is contained in:
20
e2e/support-auth.pw.ts
Normal file
20
e2e/support-auth.pw.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { expect, test } from "@playwright/test"
|
||||
|
||||
const SUPPORT_LOGIN_KEY = process.env.CMS_SUPPORT_LOGIN_KEY ?? "support-access"
|
||||
|
||||
test.describe("support fallback route", () => {
|
||||
test("valid support key opens sign-in page", async ({ page }, testInfo) => {
|
||||
test.skip(testInfo.project.name !== "admin-chromium")
|
||||
|
||||
await page.goto(`/support/${SUPPORT_LOGIN_KEY}`)
|
||||
|
||||
await expect(page.getByRole("heading", { name: /sign in to cms admin/i })).toBeVisible()
|
||||
})
|
||||
|
||||
test("invalid support key returns not found", async ({ page }, testInfo) => {
|
||||
test.skip(testInfo.project.name !== "admin-chromium")
|
||||
|
||||
const response = await page.goto("/support/invalid-key")
|
||||
expect(response?.status()).toBe(404)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user