Problem
Four edge-case test gaps identified during #259 review. None are bugs — all paths work correctly — but the behaviors are untested and could silently regress.
Deferred input derivation boundary (T2)
No test verifies that inputs are withheld when the orchestrator has not yet reached the target station. The existing tests exercise the positive case (inputs appear when orchestrator has passed) but not the negative case.
Test: Assert that when architecture has a completed output but the orchestrator is still at station 0, no input artifact appears at station 1. Then assert the input appears once the orchestrator advances.
packages/factory/src/client/visualizations/catwalk/mappers/__tests__/run-to-catwalk.test.ts
play() resume-from-paused re-emits current snapshot (T3)
play() unconditionally calls emitCurrent() then scheduleNext() regardless of whether starting fresh or resuming from paused. When resuming, this re-emits the snapshot at the current cursor position. Probably intentional but untested.
Test: Pause at cursor 1, call play(), verify update count increases by 1 immediately (re-emit), then advances again after 1500ms.
packages/factory/src/client/playback/__tests__/playback-controller.test.ts
Empty snapshot array (T4)
PlaybackController([]) → play() immediately sets state to ended without emitting anything. No test documents this contract.
Test: Construct PlaybackController([], onUpdate), call play(), verify state is ended and updates remains empty.
packages/factory/src/client/playback/__tests__/playback-controller.test.ts
resetScene() during active choreography (T5)
resetScene() sets choreographyInProgress = false and clears pendingDiff to cancel in-flight animations. The .then() callback from the prior choreography promise will still resolve after the reset — it checks choreographyInProgress (now false) and skips stale work. This is correct but untested.
Test: Trigger artifact regression while a choreography promise is mid-flight (mock to not resolve immediately). Verify the scene entity count reflects the rebuilt state, and a subsequent forward updateStatus produces correct results.
packages/factory/src/client/visualizations/catwalk/scene/__tests__/CatwalkScene.test.ts
Problem
Four edge-case test gaps identified during #259 review. None are bugs — all paths work correctly — but the behaviors are untested and could silently regress.
Deferred input derivation boundary (T2)
No test verifies that inputs are withheld when the orchestrator has not yet reached the target station. The existing tests exercise the positive case (inputs appear when orchestrator has passed) but not the negative case.
Test: Assert that when architecture has a completed output but the orchestrator is still at station 0, no input artifact appears at station 1. Then assert the input appears once the orchestrator advances.
packages/factory/src/client/visualizations/catwalk/mappers/__tests__/run-to-catwalk.test.tsplay() resume-from-paused re-emits current snapshot (T3)
play()unconditionally callsemitCurrent()thenscheduleNext()regardless of whether starting fresh or resuming from paused. When resuming, this re-emits the snapshot at the current cursor position. Probably intentional but untested.Test: Pause at cursor 1, call
play(), verify update count increases by 1 immediately (re-emit), then advances again after 1500ms.packages/factory/src/client/playback/__tests__/playback-controller.test.tsEmpty snapshot array (T4)
PlaybackController([])→play()immediately sets state toendedwithout emitting anything. No test documents this contract.Test: Construct
PlaybackController([], onUpdate), callplay(), verify state isendedand updates remains empty.packages/factory/src/client/playback/__tests__/playback-controller.test.tsresetScene() during active choreography (T5)
resetScene()setschoreographyInProgress = falseand clearspendingDiffto cancel in-flight animations. The.then()callback from the prior choreography promise will still resolve after the reset — it checkschoreographyInProgress(now false) and skips stale work. This is correct but untested.Test: Trigger artifact regression while a choreography promise is mid-flight (mock to not resolve immediately). Verify the scene entity count reflects the rebuilt state, and a subsequent forward
updateStatusproduces correct results.packages/factory/src/client/visualizations/catwalk/scene/__tests__/CatwalkScene.test.ts