fix(test): assert real shipped behaviour for signed-out /products
Caught during live local-smoke run. Refs: M4.2/M5.3
This commit was merged in pull request #9.
This commit is contained in:
@@ -12,18 +12,13 @@ test.describe("tenant subdomain @needs-stack", () => {
|
|||||||
await expect(page.getByRole("button", { name: /Sign in with Keycloak/i })).toBeVisible();
|
await expect(page.getByRole("button", { name: /Sign in with Keycloak/i })).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("acme /products requires sign-in", async ({ page }) => {
|
test("acme /products is gated when signed out", async ({ page }) => {
|
||||||
await page.goto("/products");
|
await page.goto("/products");
|
||||||
// Either the user is sent to dashboard's sign-in form, or the page renders
|
// Signed-out session means canSee(null, "products") is false, so the
|
||||||
// the canSee=false branch (NotAuthorized) depending on session state.
|
// page renders the 'NotAuthorized' component. The dashboard route is
|
||||||
// Both are legitimate; the assertion is that we do NOT see the empty
|
// the only place that surfaces the Sign-in button today — we'll add
|
||||||
// product tile body without a session.
|
// a redirect-to-sign-in in M10.1 once the surface set firms up.
|
||||||
const isSignedIn = await page.getByRole("heading", { name: /Products/i }).isVisible();
|
await expect(page.getByRole("heading", { name: /403/i })).toBeVisible();
|
||||||
if (!isSignedIn) {
|
|
||||||
await expect(
|
|
||||||
page.getByRole("button", { name: /Sign in with Keycloak/i }),
|
|
||||||
).toBeVisible();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("unknown tenant slug 404s", async ({ page }) => {
|
test("unknown tenant slug 404s", async ({ page }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user