Koha-clms/t/cypress/integration
Martin Renvoize 9284a43817
Bug 39584: Add Cypress tests for bookings lead and trail period behavior
This commit adds comprehensive Cypress tests for the lead and trail period
functionality in the bookings modal date picker. These tests validate the
hover effects, conflict detection, and date selection constraints.

The tests use cy.clock() to fix "today" to June 10, 2026, enabling
deterministic testing without date arithmetic complications.

Test coverage includes:
- Lead period visual hints (CSS classes on hover)
- Lead period conflict prevention with past dates
- Lead period conflict prevention with existing bookings
- Trail period visual hints (CSS classes on hover)
- Trail period conflict prevention with existing bookings
- Max date selection when trail period is clear (no false restrictions)

Test setup:
- Fixed date: June 10, 2026
- Lead period: 2 days
- Trail period: 3 days
- Issue length: 3 days with 2 renewals of 2 days each
- Max booking period: 7 days
- Blocker booking: June 25-27 (tests both lead and trail conflicts)

Test phases:
1. Hover June 13 - lead period (June 11-12) is clear, no leadDisable
2. Select June 13, hover June 16 - trail period (June 17-19) is clear
3a. Hover June 11 - lead period includes past date (June 9), leadDisable
3b. Hover June 29 - lead period overlaps blocker (June 27), leadDisable
4. Select June 20, hover June 23 - trail overlaps blocker, trailDisable
5. Select June 13, hover June 20 (max) - trail is clear, selectable

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-30 10:54:19 -07:00
..
Acquisitions Bug 41593: (QA follow-up) Move cypress test 2026-01-29 15:11:21 -07:00
Admin Bug 40191: Update Cypress tests for split button navigation changes 2026-01-22 09:25:55 -07:00
Auth Bug 40170: Replace cypress-mysql with mysql2 - Cypress tests 2025-07-08 15:42:03 -06:00
Circulation Bug 39584: Add Cypress tests for bookings lead and trail period behavior 2026-01-30 10:54:19 -07:00
ERM Bug 41173: Add a Cypress test 2026-01-30 10:54:01 -07:00
Islands Bug 40170: Replace cypress-mysql with mysql2 - Cypress tests 2025-07-08 15:42:03 -06:00
KohaTable Bug 38311: Fix Selenium and Cypress tests 2025-12-02 10:07:20 -07:00
Patron Bug 40245: Update cypress test to handle ShowPatronFirstnameIfDifferentThanPreferredname 2025-11-07 10:54:11 -07:00
Preservation Bug 40191: Update Cypress tests for split button navigation changes 2026-01-22 09:25:55 -07:00
SIP2 Bug 37893: (QA follow-up): Update cypress tests 2025-11-18 11:21:19 -07:00
Tools Bug 41177: Adjust Cypress tests 2025-11-25 10:13:27 -07:00
t Bug 40345: Add insertSamplePatron 2025-07-21 14:01:25 -06:00
AdditionalFields_spec.ts Bug 38446: Add a dedicated route to retrieve ERM-related additional fields 2025-11-17 15:15:38 -07:00
Breadcrumbs_spec.ts Bug 38201: Add VueFramework cypress tests 2025-10-02 09:40:16 -06:00
InfiniteScrollSelect_spec.ts Bug 40191: Update Cypress tests for split button navigation changes 2026-01-22 09:25:55 -07:00
PatronSearchDebounce_spec.ts Bug 41039: Add cypress tests 2025-11-18 06:56:54 -07:00
Toolbar_spec.ts Bug 40430: Fix Toolbar_spec.ts 2025-07-21 14:01:28 -06:00
VueFramework_spec.ts Bug 40191: Add Cypress test coverage for split button navigation 2026-01-22 09:25:55 -07:00
flatpickr_spec.ts Revert "Bug 37493: [DONT PUSH] Test only - Force test fail" 2024-09-02 17:21:50 +02:00