The route spec only checked that the protected screen opened, so a schema violating 200 or a 503 still passed it. It now asserts the mocked row, and a new spec saves once and retries after a 429 in a real browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { expect, test } from "../support/browser/strict-browser-test.ts";
|
|
import { ROUTE_REGISTRY } from "../../src/features/installed-feature-contracts.ts";
|
|
|
|
test("opens the protected integration route through the local demo seam", async ({
|
|
page,
|
|
}) => {
|
|
const protectedRoute = ROUTE_REGISTRY.REFERENCE_RESOURCE_LIST;
|
|
await page.route(
|
|
"http://localhost:8080/api/reference-resources?*",
|
|
(route) =>
|
|
route.fulfill({
|
|
json: [
|
|
{
|
|
id: "browser-reference",
|
|
name: "Browser reference",
|
|
createdAt: "2026-07-26T00:00:00.000Z",
|
|
},
|
|
],
|
|
}),
|
|
);
|
|
await page.goto(protectedRoute.path);
|
|
await expect(
|
|
page.getByRole("heading", { name: "세션이 필요합니다." }),
|
|
).toBeVisible();
|
|
|
|
await page.getByRole("button", { name: "로그인 시작" }).click();
|
|
|
|
await expect(
|
|
page.getByRole("heading", { name: protectedRoute.title }),
|
|
).toBeVisible();
|
|
await expect(page.getByText("인증됨")).toBeVisible();
|
|
// The mocked row went through the production codec, mapper and query cache.
|
|
await expect(page.getByText("Browser reference")).toBeVisible();
|
|
});
|