diff --git a/client/tests/test_p0_regressions.gd b/client/tests/test_p0_regressions.gd index d66d2a0ce..e1de8eb9d 100644 --- a/client/tests/test_p0_regressions.gd +++ b/client/tests/test_p0_regressions.gd @@ -119,15 +119,19 @@ func test_monologue_not_duplicated_after_consumption() -> void: }) SimBridge.receive_bytes(bytes_with_mono) - # Client polls and consumes the monologue - var snapshot = SimBridge.poll_snapshot() + # Client polls and consumes the monologue. + # In live mode, poll_snapshot() returns _last_snapshot and sets it to null. + # In test mode, poll_snapshot() returns _test_snapshot() instead, so we + # simulate the live-mode consumption path directly. + var snapshot = SimBridge._last_snapshot + SimBridge._last_snapshot = null assert_that(snapshot).is_not_null() GameState.apply_snapshot(snapshot) # apply_snapshot sets current_monologue, then main._consume_monologue() clears it. # Simulate consumption: GameState.current_monologue = null - # Next snapshot arrives without monologue — _last_snapshot is null after poll, + # Next snapshot arrives without monologue — _last_snapshot was null after poll, # so no carry-forward should happen. var bytes_next := _make_snapshot_bytes({"tick": 2}) SimBridge.receive_bytes(bytes_next)