diff --git a/tests/e2e/tech-log-http-contract.spec.ts b/tests/e2e/tech-log-http-contract.spec.ts index 9563094..0ab228a 100644 --- a/tests/e2e/tech-log-http-contract.spec.ts +++ b/tests/e2e/tech-log-http-contract.spec.ts @@ -34,8 +34,24 @@ for (const path of knownSpaPaths) { }); } +// 6784eb1 (08-20). The server matches each registered Public route as a +// pattern, not the slugs the build saw, so a record published after the build +// is reachable. A slug nobody published is the SPA's in-shell not-found, not an +// edge 404. +test("production HTTP serves the SPA for a slug the build has not seen", async ({ + request, +}) => { + const response = await request.get("/projects/missing-project"); + + expect(response.status()).toBe(200); + expect(response.headers()["content-type"]).toBe("text/html;charset=UTF-8"); + expect((await response.text()).startsWith("")).toBe(true); +}); + +// A route parameter matches one segment, so a second segment is still an edge +// 404, as is a path no route declares. for (const path of [ - "/projects/missing-project", + "/projects/missing-project/unknown-tab", "/definitely-not-a-product-route", ]) { test(`production HTTP returns the source-exact raw 404 for ${path}`, async ({