Koha-clms/t/cypress/integration/Circulation
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
..
FineNoRenewals_spec.ts Bug 23415: Add debt override support to circulation checkout page 2026-03-22 23:27:26 +01:00
bookingsModalBasic_spec.ts Bug 37707: (follow-up) Add comprehensive Cypress tests for bookings modal 2026-02-10 08:51:07 -07:00
bookingsModalDatePicker_spec.ts Bug 42862: Use current-relative dates in bookingsModalDatePicker_spec.ts 2026-06-29 15:38:59 +00:00
bookingsModalTimezone_spec.ts Bug 37707: (follow-up) Add comprehensive Cypress tests for bookings modal 2026-02-10 08:51:07 -07:00