896f8dbd3d
* fix: align booking limit timezone between availability and validation - Use eventType.schedule?.timeZone for booking limits in availability calculation - Previously used user's timezone causing day boundary mismatch - Add unit tests to verify timezone alignment - Fixes issue where slots remain available after reaching booking limit Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * Rename variable limitsTz to eventTimeZone * update * fix: correct timezone fallback to include user timezone without forcing UTC - Changed fallback chain to: schedule → event → user → undefined - Treats empty strings as missing timezones - Does not force UTC when all timezones are missing - Aligns with validation behavior when timezone is undefined - Fixes getSchedule.test.ts failures Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * Revert "fix: correct timezone fallback to include user timezone without forcing UTC" This reverts commit 721e0bdfd7b08004e68df6bdf5b97b9bd6cf3d5c. * test: remove complex unit tests with 'as any' casts - Removed Booking Limits Timezone Alignment tests that required heavy mocking - These tests relied on spying private methods and had many 'as any' casts - Timezone alignment is already covered by integration tests in getSchedule.test.ts - Kept BookingDateInPastError test which has no type issues Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * address review --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Unit and Integration Tests
Make sure you have copied .env.test.example to .env.test
You can run all jest tests as
yarn test
You can run tests matching specific description by following command
yarn test -t getSchedule
Tip: Use --watchAll flag to run tests on every change