21 lines
718 B
TypeScript
21 lines
718 B
TypeScript
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)
|
|
})
|
|
})
|