Skip to content

test(ui): replace time-based waits in NZ popup-fit regression tests #108

Description

@comnam90

Spun out of code review on #103 (item #9).

Context

The two NZ popup-fit regression tests in `tests/ui.spec.ts` use `page.waitForTimeout(500)` and `page.waitForTimeout(800)` after triggering the popup, to let autoPan / setView animations settle before measuring the bounding box. These will flake on slow CI hardware.

Proposed fix

Replace the timeouts with a layout-stable signal — for example:

  • `page.waitForFunction(...)` that compares the popup's bounding rect across two frames to confirm it stopped moving.
  • Or listen for Leaflet's `moveend` / `autopanend` via `page.evaluate` and resolve a promise when it fires.

Acceptance

  • No `page.waitForTimeout(...)` calls in the NZ regression tests
  • Tests still pass deterministically across all five Playwright projects

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions