village-builder

VB-1145: Fix: tests/browser.js fails on two camera checks

Status: done (2026-11-18) Priority: 1 Size: S Design ref: docs/testing.md Goal: The page’s functional test is green again Acceptance criteria:

Noted by VB-355, 18 November 2026.

Implementation (18 November 2026)

Cause: the test’s waiting, not the page. A camera glide (flyTo, src/page/cards.js) lasts 1.1 s of frame time, and src/page/frame.js counts a frame for at most 50 ms; under 20 frames a second, as headless on a shared machine, the glide outlasts the clock, and the test read the camera after fixed waits (1.8 s after Play as, 1.5 s after Show on map), mid-glide. All three messages are that one reading: Play as and Show on map read short of their tile, and the People sheet’s “before” was a camera still gliding, so its “after” differed.

Fix, in tests/browser.js only: the test hook gains gliding() (whether a glide is on), and the three checks wait for the glide to end (glided()) before reading the camera. No check or threshold changed: within 1 tile of the farm, a move of at most 1 world unit at the sheet, within a tile of the project’s tile. No file under src/ changed, so no screenshot.

Not measured: the frame rate during the failing runs; the cause is inferred from the code and from the outcome below.

Validation