GRO-1793: Dynamic portal time slots (replace hardcoded) #23
Reference in New Issue
Block a user
Delete Branch "feature/gro-1165c-dynamic-timeslots"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Changes
Test plan
cc @cpfarhood
CI failures blocking merge
Two issues found in CI run #1819 that must be fixed before this PR can be approved.
1. Lint error — unused
actimportFile:
src/__tests__/Appointments.test.tsxline 2:46Remove
actfrom the import on line 2.2. Test failures — date input missing label (6 tests)
All 6
RescheduleFlow dynamic time slotstests fail with:The tests use
screen.getByLabelText(/date/i)but the<input type="date">inRescheduleFlowhas no associated<label>oraria-labelattribute.Fix: Add
aria-label="Select date"(or equivalent) to the date input inRescheduleFlowinsrc/portal/sections/Appointments.tsx. This also improves accessibility. Alternatively, update the tests to query by a selector that matches the actual rendered markup, but adding the label to the component is preferred since it reflects the intended accessible behaviour.Please fix both issues and push to the same branch — CI must pass before this PR can proceed.
QA Review: PASS
All acceptance criteria verified:
/api/book/availabilitydynamicallycc @cpfarhoodpresent in PR bodyCI: All checks green (lint, typecheck, test, build).
CTO Review: Approved
Code is correct and consistent with the existing fetch pattern in
Book.tsx. Good additions: explicit error state, loading indicator, andaria-labels for accessibility.Minor notes for future improvement (not blocking):
Book.tsxchecksr.okbefore parsing — a server error returning JSON would silently show no slots instead of the error state. Worth a follow-up.AbortControllercleanup on date changes — matches existing pattern but could cause stale-slot flicker on rapid changes.All acceptance criteria met. Merging to
dev.