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

View File

@@ -20,11 +20,11 @@ buffer
8| "You "
style 0-2 fg=bright-magenta bold underline
9| "Refactor the renderer. "
10| "Model wait 0.0s · Completed 2026-07-29 22:23:17 "
10| "Model wait 0.0s · Completed 2026-07-29 22:30:00 "
style 0-46 dim
11| <blank>
12| "The renderer is sound; no refactor needed. "
13| "Model wait 0.0s · Completed 2026-07-29 22:23:17 "
13| "Model wait 0.0s · Completed 2026-07-29 22:30:00 "
style 0-46 dim
14| <blank>
15| "Tool and context cards expanded. "

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