Skip to content

Commit 6865624

Browse files
fix(web): pin the floor test's clock so its elapsed assertion stops expiring
The TeamFloor island test built its model at a fixed now but rendered without the now prop, so the stage ticked on the real Date.now() instead. The bubble reads through ago(), which switches from "Ns" to "Nm" at sixty seconds, so getByText(/^T2 · \d+s$/) only held during the minute after the pinned event time. That is why the same tree was green on the PR at 09:38 — a negative elapsed clamped to 0s — and red on main at 10:10, where it rendered "T2 · 10m". It took down both the Lint & Test and Pre-commit jobs, and would fail every run from here. Pass the render the same pinned clock the model was built with, as the other fourteen tests in the file already do.
1 parent 1fec851 commit 6865624

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎web/src/components/Live/floor/TeamFloor.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ beforeEach(() => {
4848

4949
describe('TeamFloor', () => {
5050
it('draws every team as an island with its people and tickets', () => {
51+
// The same clock the floor was built with: the bubble reads "T2 · 1s" off
52+
// it. Without it the stage ticks on the real Date.now(), and the elapsed
53+
// assertion below only holds in the minute after the fixed event time.
5154
const floor = buildFloor({ squads: chart, tasks, events, composition: null, running: true, now: T0 + 5000 });
52-
render(<TeamFloor floor={floor} running />);
55+
render(<TeamFloor floor={floor} running now={T0 + 5000} />);
5356

5457
expect(screen.getByTestId('team-floor')).toBeInTheDocument();
5558
const backend = screen.getByTestId('island-backend-go');

0 commit comments

Comments
 (0)