test(e2e): HTTP 계약 시험이 경로 패턴으로 서빙하는 지금 서버를 따른다
6784eb1(08-20)부터 운영 서버는 빌드가 본 slug 목록이 아니라 등록된 Public 경로 패턴으로 SPA를 낸다. 빌드 뒤에 게시한 기록도 열려야 하기 때문이다. 그래서 /projects/missing-project는 이제 200으로 SPA를 받고, 화면 안에서 not-found를 보인다. 시험은 아직 그 경로가 edge 404라고 기대해 세 엔진 모두 떨어진다. 모르는 slug는 200 SPA를 기대한다. edge 404 사례는 경로 매개변수가 한 segment만 맞는다는 것을 보이는 /projects/missing-project/unknown-tab으로 바꾼다. 경로가 없는 /definitely-not-a-product-route는 그대로 둔다. 검증: tech-log-http-contract.spec.ts가 세 엔진 모두 통과한다.
This commit is contained in:
@@ -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("<!doctype html>")).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 ({
|
||||
|
||||
Reference in New Issue
Block a user