1
0
Эх сурвалжийг харах

fix(web): type the exit assertion on the plan/mode data and correct the header comment

The exit-path assertion now reads the last plan/mode event's data.active
through a typed discriminant filter (event is SessionEvent & ...), so the
commit message and the code agree; the file header comment now describes
the committed three-boolean golden instead of the retired gap/overlap
facts.
Chinesezjc 1 сар өмнө
parent
commit
665ffb3be3

+ 5 - 2
apps/web/tests/plan-control-row.e2e.ts

@@ -149,9 +149,12 @@ describe('web e2e: plan chip click area at the narrow viewport', () => {
     // The click must have committed the exit: the last plan/mode event flips
     // inactive (the recorded turn's entry event stays active:true earlier in
     // the log, so the pair proves the exit and not just the entry).
-    const planModes = sessionEvents.filter(event => event.type === 'plan/mode')
+    const planModes = sessionEvents.filter(
+      (event): event is SessionEvent & { type: 'plan/mode'; data: { active: boolean } } =>
+        event.type === 'plan/mode',
+    )
     const lastPlanMode = planModes.at(-1)
-    expect(JSON.stringify(lastPlanMode)).toContain('"active":false')
+    expect(lastPlanMode?.data.active).toBe(false)
     expect(tripwire.pageErrors).toEqual([])
     expect(tripwire.warnings).toEqual([])
   }, 200_000)