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 }) });