test(e2e): 생성 기능 e2e의 오류 응답을 짝 백엔드 Envelope 값으로 맞춘다
생성 기능 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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user