회기 집계와 기록 복귀 및 감독 근거 링크 수정
Some checks failed
API contract / OpenAPI type drift (push) Failing after 4m46s

This commit is contained in:
Yun Chan 2026-09-09 14:41:54 +09:00
parent aa951c6c4a
commit 1306c524c1
20 changed files with 4631 additions and 60 deletions

View file

@ -99,6 +99,23 @@ async function routeReviewShell(page: Page, reviewSessionId = SESSION_ID) {
);
}
function routeLearnerReadModel(
page: Page,
expectedSessionIds: readonly string[],
handler: (route: Route) => void | Promise<void>,
) {
return page.route(
(url) =>
url.pathname === "/api/calibration/learners/me" &&
url.searchParams.has("session_id"),
async (route) => {
const sessionId = new URL(route.request().url()).searchParams.get("session_id");
expect(expectedSessionIds).toContain(sessionId);
await handler(route);
},
);
}
function initialReadModel(
requestedView: "learner" | "supervisor" = "learner",
): CalibrationTransferReadModelResponse {
@ -516,7 +533,7 @@ test.describe("G5 calibration mirror and unseen transfer", () => {
await routeUnmockedApi(page);
await routeAuth(page, "learner");
await routeReviewShell(page);
await page.route("**/api/calibration/learners/me", (route) =>
await routeLearnerReadModel(page, [SESSION_ID], (route) =>
fulfillReadModel(route, readModel),
);
await page.route("**/api/calibration/predictions/revisions", async (route) => {
@ -687,7 +704,7 @@ test.describe("G5 calibration mirror and unseen transfer", () => {
await routeUnmockedApi(page);
await routeAuth(page, "learner");
await routeReviewShell(page);
await page.route("**/api/calibration/learners/me", (route) =>
await routeLearnerReadModel(page, [SESSION_ID], (route) =>
fulfillReadModel(route, readModel),
);
@ -805,7 +822,7 @@ test.describe("G5 calibration mirror and unseen transfer", () => {
await routeUnmockedApi(page);
await routeAuth(page, "learner");
await routeReviewShell(page, PRACTICE_SESSION_ID);
await page.route("**/api/calibration/learners/me", async (route) => {
await routeLearnerReadModel(page, [PRACTICE_SESSION_ID], async (route) => {
readRequests += 1;
await fulfillReadModel(route, readModel);
});
@ -935,7 +952,7 @@ test.describe("G5 calibration mirror and unseen transfer", () => {
await routeAuth(page, "learner");
await routeReviewShell(page, PRACTICE_SESSION_ID);
await routeReviewShell(page, SESSION_ID);
await page.route("**/api/calibration/learners/me", (route) =>
await routeLearnerReadModel(page, [SESSION_ID, PRACTICE_SESSION_ID], (route) =>
fulfillReadModel(route, readModel),
);
await page.route("**/api/calibration/transfer-executions", async (route) => {
@ -997,7 +1014,7 @@ test.describe("G5 calibration mirror and unseen transfer", () => {
await routeUnmockedApi(page);
await routeAuth(page, "learner");
await routeReviewShell(page);
await page.route("**/api/calibration/learners/me", (route) =>
await routeLearnerReadModel(page, [SESSION_ID], (route) =>
fulfillReadModel(route, readModel),
);
@ -1026,7 +1043,7 @@ test.describe("G5 calibration mirror and unseen transfer", () => {
await routeUnmockedApi(page);
await routeAuth(page, "learner");
await routeReviewShell(page);
await page.route("**/api/calibration/learners/me", async (route) => {
await routeLearnerReadModel(page, [SESSION_ID], async (route) => {
if (responseMode === "pending") {
await firstResponse;
}