From 37586b444666839c8cfd8e00c269a4f8be574bee Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 23:00:21 +0900 Subject: [PATCH] =?UTF-8?q?test(e2e):=20=EC=83=9D=EC=84=B1=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20e2e=EC=9D=98=20=EC=98=A4=EB=A5=98=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=EC=9D=84=20=EC=A7=9D=20=EB=B0=B1=EC=97=94=EB=93=9C=20?= =?UTF-8?q?Envelope=20=EA=B0=92=EC=9C=BC=EB=A1=9C=20=EB=A7=9E=EC=B6=98?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 생성 기능 e2e는 짝 백엔드의 Envelope을 흉내 낸다고 적지만 실패 응답이 다르다. 429에 RATE_LIMITED와 category SYSTEM을, 500에 category SYSTEM을 보낸다. 짝 백엔드는 RATE_LIMIT_EXCEEDED(RATE_LIMIT, 429, retryable)와 INTERNAL_ERROR(INTERNAL, 500)를 보낸다(OperationalError.java). 지금은 판정이 status만 보아 결과가 같지만, code나 category를 읽게 바뀌면 시험이 실제와 다른 답으로 통과한다. 고른 방법: failure()가 category를 받고 두 응답을 백엔드 행 값으로 보낸다. 위험·한계: 짝 백엔드 행이 바뀌면 손으로 다시 맞춘다(pin 대조 밖). 검증: tests/e2e/generated-feature.spec.ts 세 엔진(desktop, PR 본문). RED 없음 — 시험 자료만 실제 값으로 바꾼다. Refs: 1112/03-09 --- tests/e2e/generated-feature.spec.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/e2e/generated-feature.spec.ts b/tests/e2e/generated-feature.spec.ts index f80d424f..63af5ac4 100644 --- a/tests/e2e/generated-feature.spec.ts +++ b/tests/e2e/generated-feature.spec.ts @@ -59,10 +59,17 @@ function envelope(data: unknown) { return { success: true, data, meta: META }; } -function failure(code: string, retryable: boolean) { +/** + * 1112/03-09. The paired backend's failure Envelope: code, category and + * retryable as its OperationalError row gives them + * (clean-architecture-backend-template src/shared-contract/.../OperationalError.java: + * RATE_LIMIT_EXCEEDED is RATE_LIMIT, 429, retryable; INTERNAL_ERROR is + * INTERNAL, 500, not retryable). + */ +function failure(code: string, category: string, retryable: boolean) { return { success: false, - error: { code, category: "SYSTEM", message: "backend message", retryable }, + error: { code, category, message: "backend message", retryable }, meta: META, }; } @@ -243,7 +250,7 @@ test.describe("the save", () => { route.fulfill({ status: 429, headers: { "retry-after": "1" }, - json: failure("RATE_LIMITED", true), + json: failure("RATE_LIMIT_EXCEEDED", "RATE_LIMIT", true), }); test("keeps the input and saves on retry", async ({ page }) => { @@ -281,7 +288,7 @@ test.describe("the save", () => { "x-correlation-id": "corr-save-500", "access-control-expose-headers": "x-correlation-id", }, - json: failure("INTERNAL_ERROR", false), + json: failure("INTERNAL_ERROR", "INTERNAL", false), }); // 0929/08-04. The case a user most wants to report shows the id support