mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
b058b63f6e
Three things the first CI run found, all of them in the new tests rather than in what they cover. The dialog's search effect depended on the location hint object. Its own hook memoises, so nothing looped in the app, but the effect sets state on a query too short to ask about, and a caller whose hook hands back a fresh literal per render turns that pair into a render loop that never yields. The suite mocked it exactly that way, and the worker hung before a single test reported, which is what took the client coverage job past half an hour. The hint is three numbers, so the effect now turns on those and reads the value out of a ref when the request goes out. The mock hands back one object, the way the real hook does. The suite also installed fake timers in a beforeEach, which deadlocks against React's scheduler and Testing Library's own waiting. Every wait is a waitFor now, and the two cases that have to prove something did not happen sit out a real pause. The debounce boundary is no longer asserted against a wall clock, because a busy runner stretches any such window. The charging fixtures are pinned to a fixed instant and the service reads the real clock against a twenty-minute freshness window, so every answer through it was stale by construction and available came back null. Date.now is pinned for those tests, never the timers, since the requests carry an AbortSignal.timeout that has to keep running. And the unidentified-station test counted its two "no reliable data" lines before the answer landed: the price line already says it while the request is out, so the count settled on one and passed for the wrong reason.