test(tui): pin the folded-snapshot clock so replay is keyless-deterministic

This commit is contained in:
Turtle
2026-07-29 22:40:59 +08:00
parent 0c9e529f74
commit 651417e01c
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -611,6 +611,7 @@ describe('TUI terminal-state snapshots', () => {
})
it('pins the hidden phase folding a multi-step turn into one assistant message', async () => {
const nowSpy = vi.spyOn(Date, 'now').mockReturnValue(new Date(2026, 6, 29, 22, 30, 0).getTime())
const harness = await setupSnapshot({
tools: ADVANCED_CARD_TOOLS,
config: { maxToolOutputLines: 3 },
@@ -632,6 +633,7 @@ describe('TUI terminal-state snapshots', () => {
await renderAfter(harness, () => { harness.terminal.send('\x0f') })
await renderAfter(harness, () => { harness.terminal.send('\x0f') })
await checkpoint('tool-cards-hidden-folded', harness.terminal, { includeScrollback: true })
nowSpy.mockRestore()
await disposeSnapshot(harness)
})