fix(ci): 校正守卫后的五条前端源码合同跟着搬家(BUG-940)

This commit is contained in:
jesse-ux
2026-09-18 10:39:23 +08:00
parent c0dd1773f7
commit 0378d9e030
7 changed files with 57 additions and 12 deletions
+10 -2
View File
@@ -205,7 +205,10 @@ test("homepage opens through the server Case API and merges the returned session
assert.ok(reveal > merge);
assert.match(handler, /rectificationOpenInFlight\.current = true;[\s\S]*?finally \{[\s\S]*?rectificationOpenInFlight\.current = false;/);
assert.doesNotMatch(handler, /onNarrativeDelta/);
assert.match(source, /const rectificationSurfaceOpen = activeRectificationSession\s*&& activeSession\.id === rectificationSessionId/);
// 原值:`const rectificationSurfaceOpen = activeRectificationSession && activeSession.id === rectificationSessionId`
// 新值:包一层 `Boolean(...)`,并先判 `activeSession`,避免无活跃会话时读 `.id`
// 原因:BUG-935 列表只剩校正时 activeSession 可为 undefined。
assert.match(source, /const rectificationSurfaceOpen = Boolean\(activeRectificationSession && activeSession && activeSession\.id === rectificationSessionId\)/);
// 原值:同一守卫内 JSX 写 pendingConsultationQuestion={rectificationPendingQuestion}
// 新值:同一守卫内 JSX 写 panel={rectificationPanel};pending 字段在 hook panel
// 原因:校正面子树状态收到 panel
@@ -226,8 +229,13 @@ test("the page never creates the session shell locally; the server owns session
test("rectification cards render only inside the active rectification session", () => {
const source = homeSurface;
const guard = readFileSync(new URL("../src/lib/rectification-session-composer-guard.ts", import.meta.url), "utf8");
assert.match(source, /activeSession\?\.sessionType === "birth_time_rectification"/);
// 原值:page 里 `activeSession?.sessionType === "birth_time_rectification"`
// 新值:Home 读 `composerLocksAsRectification(activeSession, sessions)`,类型判断在守卫 `session?.sessionType === "birth_time_rectification"`
// 原因:BUG-924/935 把「这是不是校正会话」收到守卫,卡片仍只在 `rectificationSurfaceOpen` 里渲染。
assert.match(source, /composerLocksAsRectification\(activeSession, sessions\)/);
assert.match(guard, /session\?\.sessionType === "birth_time_rectification"/);
assert.match(source, /session_type:\s*session\.sessionType/);
assert.match(source, /rectification_case_id:\s*session\.rectificationCaseId/);
assert.doesNotMatch(source, /这个会话保存了生时校正入口|恢复生时校正<\/button>/);