From 2c2990020bcc6703f237a7578ede0f6174ee743c Mon Sep 17 00:00:00 2001 From: gituser Date: Mon, 19 Oct 2026 14:20:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=83=9D=EC=84=B1=EB=90=9C=20=EB=A9=B4?= =?UTF-8?q?=EC=A0=91=20=ED=99=95=EC=9D=B8=20=EC=8B=9C=20N:1=20=EB=A9=B4?= =?UTF-8?q?=EC=A0=91=EA=B4=80=20=EC=88=9C=EC=84=9C=20=EC=B0=A8=EC=9D=B4?= =?UTF-8?q?=EB=A5=BC=20=EB=B6=88=EC=9D=BC=EC=B9=98=EB=A1=9C=20=EB=B3=B4?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API가 N:1 면접관을 기술 면접관 먼저로 재정렬해 저장하므로 getCreatedInterview는 구성만 비교하고 순서는 비교하지 않는다. Co-Authored-By: Claude Opus 5.5 --- .../interview/api/create-interview/index.ts | 3 ++- tests/profile-preparation.browser.mjs | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/features/interview-page/interview/api/create-interview/index.ts b/src/features/interview-page/interview/api/create-interview/index.ts index 507d96f..c5124e8 100644 --- a/src/features/interview-page/interview/api/create-interview/index.ts +++ b/src/features/interview-page/interview/api/create-interview/index.ts @@ -220,8 +220,9 @@ export const getCreatedInterview = async (interviewId: number, params: CreateInt const response = await apiInstance.get("/api/interviews/get", { params: { interviewId }, signal, timeout: 15_000 }); const data = normalizeCreatedInterview(response.data, params); if (!data || data.interviewId !== interviewId) throw new Error("면접 정보를 확인하지 못했습니다."); + // 서버가 N:1 면접관을 기술 면접관 먼저로 재정렬하므로 순서는 비교하지 않는다. if ("personaIds" in params && (params.personaIds.length !== data.personaIds.length || - params.personaIds.some((id, index) => data.personaIds[index] !== id))) { + params.personaIds.some((id) => !data.personaIds.includes(id)))) { throw new Error("생성된 면접관 정보가 선택한 설정과 일치하지 않습니다."); } return data; diff --git a/tests/profile-preparation.browser.mjs b/tests/profile-preparation.browser.mjs index 4c9acb6..11240bf 100644 --- a/tests/profile-preparation.browser.mjs +++ b/tests/profile-preparation.browser.mjs @@ -113,7 +113,9 @@ async function fixture(options = {}) { mode: request.postDataJSON().personaIds ? "MULTI" : "SOLO", status: "IN_PROGRESS", } }); if (pathname === "/api/interviews/get") return json({ data: { - interviewId: 42, sessionId: "test-session", userId: 7, personaId: 1, personaIds: state.createdPersonaIds, + // reversePersonas: 서버가 N:1 면접관을 기술 면접관 먼저로 재정렬해 돌려주는 경우 + interviewId: 42, sessionId: "test-session", userId: 7, personaId: 1, + personaIds: state.reversePersonas ? [...state.createdPersonaIds].reverse() : state.createdPersonaIds, mode: state.createdPersonaIds.length > 1 ? "MULTI" : "SOLO", status: "IN_PROGRESS", questions: [], } }); if (pathname === "/api/interviews/42") return state.start404 ? json({ message: "포트폴리오 분석을 먼저 진행해주세요" }, 404) : json({ data: { interviewId: 42, sessionId: "test-session" } }); @@ -264,8 +266,8 @@ try { } } - for (const path of ["/main/setting/interview", "/main/setting/interview/multi"]) { - const f = await fixture({ start404: true, preparation: preparation("NOT_REQUESTED") }); + for (const [path, reversePersonas] of [["/main/setting/interview", false], ["/main/setting/interview/multi", false], ["/main/setting/interview/multi", true]]) { + const f = await fixture({ start404: true, preparation: preparation("NOT_REQUESTED"), reversePersonas }); await f.navigate(path); const next = f.page.getByRole("button", { name: "다음: 기업 선택", exact: true }); await expectEnabled(next, true); @@ -282,7 +284,7 @@ try { await f.page.getByText("포트폴리오 분석을 먼저 진행해주세요", { exact: true }).waitFor(); assert.equal(await f.page.getByRole("link", { name: "마이페이지로 이동", exact: true }).count(), 1); await f.close(); - report(`${path}: start 404 links to materials`); + report(`${path}: start 404 links to materials${reversePersonas ? " (server reorders personas)" : ""}`); } const waiting = await fixture({ preparation: preparation("PREPARING", { chatDelivered: true, retryAfterMs: 4_500 }) });