Koha-clms/t/cypress
Kyle M Hall b302481a4d
Bug 42862: Use current-relative dates in bookingsModalDatePicker_spec.ts
The booking date picker tests fake "today" with cy.clock and create bookings on
hardcoded June 2026 dates. The modal fetches existing bookings from from
the api and that query uses the real current time, not the fake one in the browser.
Once the real date passes the hardcoded dates, the server stops returning those bookings (
they are now in the past ), so the modal sees no conflicts and assertions such as "the date
should have the leadDisable class" fail.

This patch anchors each test's "today" to the start of next month based on the current
date so the bookings always stay in the future and are returned no
matter when the test runs.

The 'any item' test also sets cy.clock before its second page reload
because the freeze does not survive the reload.

Test Plan:
1) On main run:
   yarn cypress run --spec t/cypress/integration/Circulation/bookingsModalDatePicker_spec.ts
2) Note the test fails
3) Apply this patch
4) Run the command again
5) Note all tests pass!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-06-29 15:38:59 +00:00
..
component Bug 38446: Add a unit test for the additional fields wrapper 2025-11-17 15:15:47 -07:00
fixtures Bug 41247: Add cypress tests 2026-04-16 15:54:10 -06:00
integration Bug 42862: Use current-relative dates in bookingsModalDatePicker_spec.ts 2026-06-29 15:38:59 +00:00
plugins Bug 42080: Add Cypress tests 2026-06-26 11:56:59 +00:00
support Bug 40816: Ignore 'ResizeObserver loop limit exceeded' 2026-04-23 09:24:54 -06:00