Skip to content

Remove hardcoded language tag and fix translate="no" #338

Remove hardcoded language tag and fix translate="no"

Remove hardcoded language tag and fix translate="no" #338

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / Vitest report failed Jun 28, 2023 in 0s

Vitest report ❌

Tests failed

❌ packages/client/junit.xml

278 tests were completed in 143s with 268 passed, 1 failed and 9 skipped.

Test suite Passed Failed Skipped Time
src/tests/auth.test.ts 4✅ 2s
src/tests/cloudFunctions.test.ts 23✅ 10s
src/tests/customerDataTriggers.test.ts 3✅ 1s
src/tests/dataTriggers.test.ts 11✅ 1❌ 19s
src/tests/firestoreRules.test.ts 39✅ 9s
src/tests/integrations.test.ts 1⚪ 0ms
src/tests/migrations.test.ts 8✅ 2⚪ 7s
src/tests/sendEmail.test.ts 3✅ 837ms
src/tests/smokeTest.test.ts 1✅ 8ms
src/components/atoms/SlotOperationButtons/tests/CopyButton.test.tsx 5✅ 88ms
src/components/atoms/SlotOperationButtons/tests/DeleteButton.test.tsx 7✅ 88ms
src/components/atoms/SlotOperationButtons/tests/EditSlotButton.test.tsx 4✅ 74ms
src/components/atoms/SlotOperationButtons/tests/NewSlotButton.test.tsx 4✅ 77ms
src/components/atoms/SlotOperationButtons/tests/PasteButton.test.tsx 6⚪ 0ms
src/components/atoms/SlotOperationButtons/tests/SlotOperationButtons.test.tsx 6✅ 113ms
src/controllers/AttendanceCard/tests/AttendanceCard.test.tsx 1✅ 209ms
src/controllers/BookingsCountdown/tests/BookingsCountdownContainer.test.tsx 1✅ 113ms
src/controllers/SlotCard/tests/SlotCard.test.tsx 8✅ 177ms
src/features/modal/tests/store.test.ts 7✅ 16ms
src/features/modal/tests/useModal.test.ts 4✅ 55ms
src/features/modal/components/AddAttendedCustomersDialog/tests/AddAttendedCustomersDialog.test.tsx 4✅ 194ms
src/features/modal/components/DeleteCustomerDialog/tests/DeleteCustomerDialog.test.tsx 2✅ 79ms
src/features/modal/components/DeleteSlotDialog/tests/DeleteSlotDialog.test.tsx 2✅ 99ms
src/features/modal/components/DeleteSlotDisabledDialog/tests/DeleteSlotDisabledDialog.test.tsx 1✅ 85ms
src/features/modal/components/ExtendBookingDateDialog/tests/ExtendBookingDateDialog.test.tsx 2✅ 91ms
src/features/modal/components/FinalizeBookingsDialog/tests/FinalizeBookingsDialog.test.tsx 2✅ 83ms
src/features/modal/components/FinalizeBookingsDialog/tests/finalizeBookingsUtils.test.ts 1✅ 438ms
src/features/modal/components/Modal/tests/Modal.test.tsx 2✅ 125ms
src/features/modal/components/SendBookingsLinkDialog/tests/SendBookingsLinkDialog.test.tsx 4✅ 83ms
src/features/modal/components/SendBookingsLinkDialog/tests/sendBookingsLinkDialogUtils.test.ts 8✅ 13ms
src/features/modal/components/SendICSDialog/tests/SendICSDialog.test.tsx 3✅ 515ms
src/features/notifications/tests/notifications.test.ts 8✅ 13ms
src/pages/customers/tests/customers.test.ts 3✅ 5ms
src/store/actions/tests/attendanceOperations.test.ts 7✅ 3s
src/store/actions/tests/authOperations.test.ts 2✅ 9ms
src/store/actions/tests/bookingOperations.test.ts 10✅ 1s
src/store/actions/tests/copyPaste.test.ts 6✅ 1s
src/store/actions/tests/customerOperations.test.ts 7✅ 943ms
src/store/actions/tests/slotOperations.test.ts 6✅ 933ms
src/store/selectors/tests/calendar.test.ts 1✅ 9ms
src/store/selectors/tests/customers.test.ts 2✅ 12ms
src/store/selectors/tests/slots.test.ts 3✅ 13ms
src/store/selectors/attendance/tests/attendance.test.ts 5✅ 21ms
src/store/selectors/bookings/tests/bookings.test.ts 17✅ 32ms
src/utils/tests/sort.test.ts 10✅ 7ms
src/utils/tests/utils.test.ts 11✅ 18ms

✅ src/tests/auth.test.ts

✅ Test authentication > Test queryAuthStatus > should successfully query admin status using email
✅ Test authentication > Test queryAuthStatus > should successfully query customer status using email
✅ Test authentication > Test queryAuthStatus > should successfully query customer status using phone
✅ Test authentication > Test queryAuthStatus > should reject if no 'organization' or 'authString' provided

✅ src/tests/cloudFunctions.test.ts

✅ Cloud functions > ping > should respond if pinged
✅ Cloud functions > sendMail > should reject if user not authenticated (and not an admin)
✅ Cloud functions > sendMail > should reject to sendEmail if no smtp secrets were set
✅ Cloud functions > sendMail > should reject if email type not provided or not of supported email type
✅ Cloud functions > sendMail > should not reject if user not admin but has secretKey
✅ Cloud functions > sendMail > should reject if no value for organziation provided
✅ Cloud functions > sendMail > should reject if no recipient provided
✅ Cloud functions > finalizeBookings > should remove extended date from customer's data in firestore, and, in effect, customer's bookings
✅ Cloud functions > finalizeBookings > should return an error if no payload provided
✅ Cloud functions > finalizeBookings > should return an error if no organziation, id or secretKey provided
✅ Cloud functions > finalizeBookings > should return an error if customer id and secretKey mismatch
✅ Cloud functions > finalizeBookings > should return an error if customer not found
✅ Cloud functions > customerSelfUpdate > should update customer data in customer collection and then bookings collection by data trigger
✅ Cloud functions > customerSelfUpdate > should return an error if no payload provided
✅ Cloud functions > customerSelfUpdate > should return an error if no organziation, or customer provided
✅ Cloud functions > customerSelfUpdate > should return an error if id or secretKey are not provided in customer object
✅ Cloud functions > customerSelfUpdate > should return an error if customer id and secretKey mismatch
✅ Cloud functions > customerSelfUpdate > should return an error if customer not found
✅ Cloud functions > customerSelfRegister > should create a new customer with data passed in as well as bookings entry
✅ Cloud functions > customerSelfRegister > should return an error if no payload provided
✅ Cloud functions > customerSelfRegister > should return an error if no organization, or customer provided
✅ Cloud functions > customerSelfRegister > should return an error if 'email' nor 'phone' are not provided in customer object
✅ Cloud functions > customerSelfRegister > should validate registration code

✅ src/tests/customerDataTriggers.test.ts

✅ Customer triggers > should apply secretKey and customerId (to customer structure) when a customer record is added
✅ Customer triggers > should create bookings entry (for customer) when a customer record is created
✅ Customer triggers > should update customer's 'bookings' entry when a customer record is updated

❌ src/tests/dataTriggers.test.ts

❌ Cloud functions -> Data triggers -> > createAttendanceForBooking > should create attendance entry for booking and not overwrite existing data in slot
	AssertionError: expected { date: '2021-03-01', …(1) } to deeply equal { date: '2021-03-01', …(1) }
✅ Cloud functions -> Data triggers -> > aggreagateSlots > should create slotsByDay entry for slot on create
✅ Cloud functions -> Data triggers -> > aggreagateSlots > should update aggregated slotsByDay on slot update
✅ Cloud functions -> Data triggers -> > aggreagateSlots > should remove slot from slotsByDay on slot delete
✅ Cloud functions -> Data triggers -> > createAttendanceForSlot > should create attendance entry for slot (containing only the date) in 'attendance' collection, only on create slot (not on update)
✅ Cloud functions -> Data triggers -> > createAttendanceForSlot > should delete attendance entry for slot when the slot is deleted
✅ Cloud functions -> Data triggers -> > createAttendanceForSlot > should delete attendance entry for slot when the slot is deleted
✅ Cloud functions -> Data triggers -> > registerCreatedOrgSecret > should update 'existingSecrets' in organization data document when secrets get added or removed
✅ Cloud functions -> Data triggers -> > registerCreatedOrgSecret > updates 'smtpConfigured' with respect to smtp config being present in organization data
✅ Cloud functions -> Data triggers -> > createPublicOrgInfo > should update/create general info in organization data to publicOrgInfo collection when organization data is updated
✅ Cloud functions -> Data triggers -> > createAttendedSlotsForAttendance > should update the document in attendedSlots with respect to customer's attendance on slot
✅ Cloud functions -> Data triggers -> > createAttendedSlotsForAttendance > should not create document in attendedSlots collection if customer had booked the slot

✅ src/tests/firestoreRules.test.ts

✅ Firestore rules > Organization rules > should allow organziation admin read and write access to organization
✅ Firestore rules > Organization rules > should not allow read nor write access to an unauth user
✅ Firestore rules > Organization rules > should not allow read nor write access to authenticated user if not admin for current organization
✅ Firestore rules > Slots rules > should not allow access to unauth user
✅ Firestore rules > Slots rules > should allow access if organization admin (for delete) and slot interface is correct (for write/update)
✅ Firestore rules > Slots rules > should not allow create/update if slot date not valid
✅ Firestore rules > Slots rules > should not allow create/update if slot type not valid
✅ Firestore rules > Slots rules > should not allow create/update if slot category not valid
✅ Firestore rules > Slots rules > should allow updating a slot with "adults" category, but disallow new creating new slots with said category
✅ Firestore rules > SlotsByDay rules > should allow read access to all
✅ Firestore rules > SlotsByDay rules > should not allow write access (the collection is updated by cloud functions)
✅ Firestore rules > Bookings rules > should allow anybody read access to bookings document
✅ Firestore rules > Bookings rules > should not allow anyone to create ta booking doc (as it's handled through cloud functions)
✅ Firestore rules > Bookings rules > should not allow update access to non-admins
✅ Firestore rules > Bookings rules > should not allow delete access to non-admins (as it's handled through cloud functions)
✅ Firestore rules > Bookings rules > should allow anybody to read and write (create/update/delete) booked slots (semi auth is done by possesion of 'secretKey')
✅ Firestore rules > Bookings rules > should not allow create/update of booking subscribing to non-existing slot
✅ Firestore rules > Bookings rules > should not allow create/update of booking subscribing to non-existing interval
✅ Firestore rules > Bookings rules > should not allow create/update of invalid booking entry
✅ Firestore rules > Bookings rules > should not allow customer to subscribe to slot not supporting their category
✅ Firestore rules > Customers rules > should only allow admin access
✅ Firestore rules > Customers rules > should allow read/write to org admin
✅ Firestore rules > Customers rules > should not allow create/update if required fields (name, surname) not provided
✅ Firestore rules > Customers rules > should allow create/update with empty strings as values of optional strings (as is in CustomerForm in production)
✅ Firestore rules > Customers rules > should not allow create/update if 'covidCertificateReleaseDate' provided, but not a valid date
✅ Firestore rules > Customers rules > should not allow create/update if 'certificateExpiration' provided, but not a valid date
✅ Firestore rules > Customers rules > should not allow create/update if birthday provided, but not a valid date
✅ Firestore rules > Customers rules > should not allow create/update if phone provided but not valid
✅ Firestore rules > Customers rules > should not allow create/update if email provided but not valid
✅ Firestore rules > Customers rules > should not allow create/update if invalid category
✅ Firestore rules > Customers rules > should allow updating customer in "adults" category, but disallow creation of new customers in (non-spacific) "adults" category
✅ Firestore rules > Customers rules > should not allow create/update if 'covidCertificateSuspended' provided, but not boolean
✅ Firestore rules > Customers rules > should allow `extendedDate` update
✅ Firestore rules > Attendance rules > should not allow non-admin users read nor write access
✅ Firestore rules > Attendance rules > should allow admin read and update access (create/delete are handled through cloud functions)
✅ Firestore rules > Attendance rules > should not allow date update (as that is handled through cloud functions on slot update)
✅ Firestore rules > EmailQueue rules > should not allow anybody read/write access to 'emailQueue' as it's written to only by cloud functions
✅ Firestore rules > SMSQueue rules > should not allow anybody read/write access to 'smsQueue' as it's written to only by cloud functions
✅ Firestore rules > Secrets rules > should not allow anybody read/write access to 'secrets', it should only be written to from firebase console

✅ src/tests/integrations.test.ts

⚪ Email sending and delivery > should deliver an email with correct message and recipients

✅ src/tests/migrations.test.ts

✅ Migrations > 'pruneSlotsByDay' > should delete all 'slotsByDay' entries not containing any slots
✅ Migrations > 'pruneSlotsByDay' > should not allow access to unauth users
⚪ Migrations > 'deleteOrphanedBookings' > should remove bookings without customer entries
⚪ Migrations > 'deleteOrphanedBookings' > should not allow calls to non-admin
✅ Migrations > 'migrateSlotsCategoriesToExplicitMinors' > should replace "pre-competitive" and "course" category entries with corresponging "-minor" category entries, while leaving the existing categories as they are
✅ Migrations > 'migrateSlotsCategoriesToExplicitMinors' > should replace "pre-competitive" and "course" category entries with corresponging "-minor" category entries, in customer documents
✅ Migrations > 'migrateSlotsCategoriesToExplicitMinors' > should not allow calls to non-admins
✅ Migrations > customersToPluralCategories > should change customer's category field into an array instead of scalar
✅ Migrations > customersToPluralCategories > should not throw an error if category is already an array
✅ Migrations > customersToPluralCategories > should not allow calls to non-admins

✅ src/tests/sendEmail.test.ts

✅ SendEmail > should construct an email of type send-bookings-link and hand it over for delivery
✅ SendEmail > should construct an email of type send-calendar-file and hand it over for delivery
✅ SendEmail > should construct an email of type send-extended-bookings-date and hand it over for delivery

✅ src/tests/smokeTest.test.ts

✅ Smoke test > Test i18n setup > should initialize i18n with the tests

✅ src/components/atoms/SlotOperationButtons/tests/CopyButton.test.tsx

✅ SlotOperationButtons > 'CopyButton' functionality test > if 'contextType="day"' should add all slots of the day to clipboard on click
✅ SlotOperationButtons > 'CopyButton' functionality test > if 'contextType="week"' should add all slots of the week to clipboard on click
✅ SlotOperationButtons > 'CopyButton' edge cases/error handling test > should not render the button and should log error to console if not under 'SlotOperationButtons' context
✅ SlotOperationButtons > 'CopyButton' edge cases/error handling test > should not render the button and should log error to console if within 'contextType="slot"'
✅ SlotOperationButtons > 'CopyButton' edge cases/error handling test > should not render the button and should log error to console if within 'contextType="day" | "week"' and no value for 'date' has been provided within the context

✅ src/components/atoms/SlotOperationButtons/tests/DeleteButton.test.tsx

✅ SlotOperationButtons > DeleteButton > should open 'DeleteSlotDialog' modal onClick if within "slot" context
✅ SlotOperationButtons > DeleteButton > should show 'DeleteSlotDisabledDialog' modal onClick if within "slot" context and delete disabled
✅ SlotOperationButtons > DeleteButton > should dispatch 'deleteSlotsDay' onClick if within "day" context
✅ SlotOperationButtons > DeleteButton > should dispatch 'deleteSlotsWeek' onClick if within "week" context
✅ SlotOperationButtons > 'DeleteButton' edge cases/error handling test > should not render the button and should log error to console if not within 'SlotOperationButtons' context
✅ SlotOperationButtons > 'DeleteButton' edge cases/error handling test > should not render the button and should log error to console if within 'contextType="slot"' and no value for 'slot' has been provided within the context
✅ SlotOperationButtons > 'DeleteButton' edge cases/error handling test > should not render the button and should log error to console if within 'contextType="day" | "week"' and no value for 'date' has been provided within the context

✅ src/components/atoms/SlotOperationButtons/tests/EditSlotButton.test.tsx

✅ SlotOperationButtons > 'EditSlotButton' functionality test > should open 'SlotFormDialog' on click (with current slot as 'slotToEdit')
✅ SlotOperationButtons > 'EditSlotButton' edge cases/error handling test > should not render the button and should log error to console if not within 'SlotOperationButtons' context
✅ SlotOperationButtons > 'EditSlotButton' edge cases/error handling test > should not render the button and should log error to console if no value for 'slot' param has been provided within the context
✅ SlotOperationButtons > 'EditSlotButton' edge cases/error handling test > should not render the button and should log error to console if trying to render under any 'contextType' other than "slot"

✅ src/components/atoms/SlotOperationButtons/tests/NewSlotButton.test.tsx

✅ SlotOperationButtons > 'NewSlotButton' functionality test > should open 'SlotFormDialog' on click
✅ SlotOperationButtons > 'NewSlotButton' edge cases/error handling test > should not render the button and should log error to console if not within 'SlotOperationButtons' context
✅ SlotOperationButtons > 'NewSlotButton' edge cases/error handling test > should not render the button and should log error to console if trying to render within any context other than "day"
✅ SlotOperationButtons > 'NewSlotButton' edge cases/error handling test > should not render the button and should log error to console if no value for 'date' param has been provided within the context

✅ src/components/atoms/SlotOperationButtons/tests/PasteButton.test.tsx

⚪ SlotOperationButtons > 'PasteButton' functionality test > if 'contextType="day"' should paste all slots of the day in clipboard to new day
⚪ SlotOperationButtons > 'PasteButton' functionality test > if 'contextType="week"' should paste the week slots from clipboard to new week
⚪ SlotOperationButtons > 'PasteButton' functionality test > should be disabled if no 'slotsToCopy' for given 'contextType'
⚪ SlotOperationButtons > 'PasteButton' edge cases/error handling test > should not render the button and should log error to console if not within 'SlotOperationButtons' context
⚪ SlotOperationButtons > 'PasteButton' edge cases/error handling test > should not render the button and should log error to console if within 'contextType="slot"'
⚪ SlotOperationButtons > 'PasteButton' edge cases/error handling test > should not render the button and should log error to console if within 'contextType="day" | "week"' and no value for 'date' has been provided within the context

✅ src/components/atoms/SlotOperationButtons/tests/SlotOperationButtons.test.tsx

✅ SlotOperationButtons > Smoke test > should render whitelisted buttons 'contextType="slot"' without error with all appropriate buttons passed in
✅ SlotOperationButtons > Smoke test > should render whitelisted buttons 'contextType="day"' without error with all appropriate buttons passed in
✅ SlotOperationButtons > Smoke test > should render whitelisted buttons 'contextType="week"' without error with all appropriate buttons passed in
✅ SlotOperationButtons > Test context functionality > should provide children with the 'contextType' provided as props
✅ SlotOperationButtons > Test context functionality > should provide children with the context of 'slot' if provided as props
✅ SlotOperationButtons > Test context functionality > should provide children with the context of 'date' provided as props

✅ src/controllers/AttendanceCard/tests/AttendanceCard.test.tsx

✅ AttendanceCard > Test opening AddAttendedCustomersDialog modal > should open an 'AddAttendedCustomers' modal on 'Add Customers' click

✅ src/controllers/BookingsCountdown/tests/BookingsCountdownContainer.test.tsx

✅ BookingsCountdown > should open a finalize bookings modal on 'Finalize' button click

✅ src/controllers/SlotCard/tests/SlotCard.test.tsx

✅ SlotCard > Smoke test > should render properly
✅ SlotCard > Smoke test > should render intervals
✅ SlotCard > Smoke test > should render startTime-endTime string
✅ SlotCard > SlotOperationButtons functionality > should open slot form on edit slot click
✅ SlotCard > SlotOperationButtons functionality > should initiate delete-slot flow on delete button click
✅ SlotCard > SlotOperationButtons functionality > should show delete-disabled dialog on delete button click if delete disabled
✅ SlotCard > Test clicking on slot card > should fire 'onClick' function if provided
✅ SlotCard > Test clicking on slot card > should not explode on click if no 'onClick' handler has been provided

✅ src/features/modal/tests/store.test.ts

✅ Modal store tests > Open modal action > should add modal to the store state with appropriate component and props
✅ Modal store tests > Open modal action > if the modal is already open, should fail with a warning
✅ Modal store tests > Update modal action > should update an existing modal in the store with the updated props
✅ Modal store tests > Update modal action > should fail silently if updated modal doesn't exist in open modals stack
✅ Modal store tests > Close modal action > should remove the specific modal from store state effectively removing the modal from the screen
✅ Modal store tests > Pop modal action > should pop the latest modal from store state effectively removing the modal from the screen
✅ Modal store tests > Close all modals action > should remove all modals from the state, removing any modal from the screen

✅ src/features/modal/tests/useModal.test.ts

✅ useModal hook > should open a modal on open call
✅ useModal hook > should open the modal with props explicitly passed in on 'openWithProps'
✅ useModal hook > should not open the modal on 'open' call if props not passed in through hook call
✅ useModal hook > should dispatch 'updateModal' only if the props aren't deeply equal

✅ src/features/modal/components/AddAttendedCustomersDialog/tests/AddAttendedCustomersDialog.test.tsx

✅ AddAttendedCustomersDialog > should call onClose on 'x' button click
✅ AddAttendedCustomersDialog > should add customer as having attended a default interval of given slot on customer click
✅ AddAttendedCustomersDialog > should not render 'deleted' customers
✅ AddAttendedCustomersDialog > should close the modal when there are no customers to mark as having attended

✅ src/features/modal/components/DeleteCustomerDialog/tests/DeleteCustomerDialog.test.tsx

✅ DeleteCustomerDialog > should call 'onClose' on cancel
✅ DeleteCustomerDialog > should call delete customer with customer data and close all of the modals on confirm

✅ src/features/modal/components/DeleteSlotDialog/tests/DeleteSlotDialog.test.tsx

✅ DeleteSlotDialog > should call onClose on cancel
✅ DeleteSlotDialog > should call delete slot with slot id and close the modal on confirm

✅ src/features/modal/components/DeleteSlotDisabledDialog/tests/DeleteSlotDisabledDialog.test.tsx

✅ DeleteSlotDisabledDialog > should call onClose on 'Dismiss' button click

✅ src/features/modal/components/ExtendBookingDateDialog/tests/ExtendBookingDateDialog.test.tsx

✅ ExtendBookingDateDialog > should call onClose on cancel
✅ ExtendBookingDateDialog > should dispatch 'extendBookingDate' with the customer id and the extended date provided

✅ src/features/modal/components/FinalizeBookingsDialog/tests/FinalizeBookingsDialog.test.tsx

✅ FinalizeBookingsDialog > should call onClose on cancel
✅ FinalizeBookingsDialog > should call onClose on cancel

✅ src/features/modal/components/FinalizeBookingsDialog/tests/finalizeBookingsUtils.test.ts

✅ Finalize bookings dialog utils > finalizeBookings > should remove extended bookings from firestore

✅ src/features/modal/components/Modal/tests/Modal.test.tsx

✅ Modal > test rendering of modal stack > should render a stack of modals
✅ Modal > test rendering of modal stack > should reflect LIFO closing of the modals

✅ src/features/modal/components/SendBookingsLinkDialog/tests/SendBookingsLinkDialog.test.tsx

✅ SendBookingsLinkDialog > should call onClose on cancel
✅ SendBookingsLinkDialog > should call onClose on cancel
✅ SendBookingsLinkDialog > should call 'sendBookingsLink' with 'email' method if method = "email" and close the modal
✅ SendBookingsLinkDialog > should call 'sendBookingsLink' with 'sms' method if method = "sms" and close the modal

✅ src/features/modal/components/SendBookingsLinkDialog/tests/sendBookingsLinkDialogUtils.test.ts

✅ Send bookings link dialog utils > getDialogPrompt > should display 'email' prompt for method = "email" when 'email' defined
✅ Send bookings link dialog utils > getDialogPrompt > should display 'sms' prompt for method = "sms" when 'phone' defined
✅ Send bookings link dialog utils > getDialogPrompt > should display 'no-email' prompt and disable confirmation for method = "email" when 'email' undefined
✅ Send bookings link dialog utils > getDialogPrompt > should display 'no-sms' prompt and disable confirmation for method = "sms" when 'phone' undefined
✅ Send bookings link dialog utils > sendBookingsLink > should call a mail sending cloud function if method = 'email'
✅ Send bookings link dialog utils > sendBookingsLink > should call an SMS sending cloud function if method = 'sms'
✅ Send bookings link dialog utils > sendBookingsLink > should show error notification if function call unsuccessful
✅ Send bookings link dialog utils > getBookingsLink > should return a bookings link taking into account domain name and customer secretKey

✅ src/features/modal/components/SendICSDialog/tests/SendICSDialog.test.tsx

✅ SendICSDialog > ICS File Email Test > should close the modal on cancel
✅ SendICSDialog > ICS File Email Test > should send the ICS file to the email provided
✅ SendICSDialog > ICS File Email Test > should send the ICS file to customer's email, if no email provided

✅ src/features/notifications/tests/notifications.test.ts

✅ Notification store table tests > Enqueue action: if queue empty, should enqueue notification and set 'canEvict' to false
✅ Notification store table tests > Enqueue action: if queue not empty and 'canEvict' false, should enqueue new notificaiton at the end of the queue
✅ Notification store table tests > Enqueue action: if queue not empty, but 'canEvict' true, should evict existing notification and replace with the new one
✅ Notification store table tests > Next action: if queue longer than 1, should move to the next notification (by evicting the currently first)
✅ Notification store table tests > Next action: if only one notification in queue, should not evict the notification, but set 'canEvict' to true
✅ Notification store table tests > Evict action: should remove first notification regardless of it being the only one
✅ Notification store table tests > Evict action: should always set 'canEvict' to false when evicting
✅ Notification store table tests > Evict action: should not break on empty queue

✅ src/pages/customers/tests/customers.test.ts

✅ `getNewSubscriptionNumber` function > should return the string '1' when there are no customers
✅ `getNewSubscriptionNumber` function > should return the string '2' if there is a customers with '1'
✅ `getNewSubscriptionNumber` function > should return the string '10' if the largest number present is 9

✅ src/store/actions/tests/attendanceOperations.test.ts

✅ Attendance operations > markAttendance > should update attendance for provided customer on provided slot (and not overwrite the rest of the data for given document in the process)
✅ Attendance operations > markAttendance > should create new entry if customer didn't book
✅ Attendance operations > markAttendance > should enqueue error snackbar if update not successful
✅ Attendance operations > markAttendanceWithCustomInterval > shoud add the interval to the slot and mark attendance
✅ Attendance operations > markAbsence > should mark customers attended interval as 'null' if customer booked beforehand (and not overwrite the rest of the data for given document in the process)
✅ Attendance operations > markAbsence > should remove customer from attendance record for slot if customer didn't book (and is marked absent)
✅ Attendance operations > markAbsence > should enqueue error snackbar if update not successful

✅ src/store/actions/tests/authOperations.test.ts

✅ Auth operations > test updating auth state on user changed > should update user auth state to local store
✅ Auth operations > test updating auth state on user changed > should reset the state (perform local logout) if no user is received

✅ src/store/actions/tests/bookingOperations.test.ts

✅ Booking operations > 'bookInterval' > should book selected interval on call and enqueue success notification
✅ Booking operations > 'bookInterval' > should enqueue error notification if operation failed
✅ Booking operations > 'cancelBooking' > should remove selected booking entry and enqueue success notification
✅ Booking operations > 'cancelBooking' > should enqueue error notification if operation failed
✅ Booking operations > 'updateBookingNote' > should update the 'bookingNote' on a booking and enqueue success notification
✅ Booking operations > 'updateBookingNote' > should enqueue error notification if operation failed
✅ Booking operations > 'customerSelfUpdate' > should update the customer in firestore
✅ Booking operations > 'customerSelfUpdate' > should enqueue error notification if operation failed
✅ Booking operations > 'customerSelfRegister' > should update the customer in firestore
✅ Booking operations > 'customerSelfRegister' > should enqueue error notification if operation failed

✅ src/store/actions/tests/copyPaste.test.ts

✅ Copy Paste actions > copySlotsDay > should store the slots for the day in the clipboard and remove any week slots in the clipboard (if such exist)
✅ Copy Paste actions > copySlotsWeek > should store the slots for the week in the clipboard and remove any day slots in the clipboard (if such exist)
✅ Copy Paste actions > pasteSlotsDay > should update firestore with slots day from clipboard pasted to new day (with new slots having uuid generated ids and without messing up the new day)
✅ Copy Paste actions > pasteSlotsDay > should display error message on fail
✅ Copy Paste actions > pasteSlotsWeek > should dispatch 'setSlotDayToClipboard' with appropriate slots
✅ Copy Paste actions > pasteSlotsWeek > should show error message on unsuccessful update operation

✅ src/store/actions/tests/customerOperations.test.ts

✅ customerOperations > updateCustomer > should create a new entry in 'customers' collection (with server assigned id)
✅ customerOperations > updateCustomer > should update existing customer in database
✅ customerOperations > updateCustomer > error
✅ customerOperations > deleteCustomer > should delete existing customer in database
✅ customerOperations > deleteCustomer > error
✅ customerOperations > extendBookingDate > should add appropriate 'extendedDate' to the customer structure and show success notification
✅ customerOperations > extendBookingDate > should show error notification if function call unsuccessful

✅ src/store/actions/tests/slotOperations.test.ts

✅ Slot operations > create new slot > should add new slot to firestore (with generated uuid) and show success notification
✅ Slot operations > create new slot > should show error notification if operation is failed
✅ Slot operations > update slot > should edit an existing slot in firestore and show succes notification
✅ Slot operations > update slot > should show error notification if operation is failed
✅ Slot operations > deleteSlot > should delete slot from firestore and show succes notification
✅ Slot operations > deleteSlot > should show error notification if operation is failed

✅ src/store/selectors/tests/calendar.test.ts

✅ calendar selector > calendar slots > should return calendar data in correct format

✅ src/store/selectors/tests/customers.test.ts

✅ Customer Selectors > Customers birthdays > should get customers sorted according to their birthday
✅ Customer Selectors > Customers birthdays > should omit customers with no birthday specified

✅ src/store/selectors/tests/slots.test.ts

✅ Slot selectors >  > Test 'getAdminSlots' selector > should get all slots for given week
✅ Slot selectors >  > Test 'getAdminSlots' selector > should return empty days if no slots in store ('slotsByDay' = null)
✅ Slot selectors >  > Test 'getAdminSlots' selector > should get all slots for given week even if passed a non-week-start date

✅ src/store/selectors/attendance/tests/attendance.test.ts

✅ Selectors -> > Test 'getSlotsWithAttendance' > should get slots for current day (read from store) with customers attendance (sorted by booked interval) data for each slot
✅ Selectors -> > Test 'getMonthAttendanceVariance' > should filter attendance collection by date
✅ Selectors -> > Test 'getMonthAttendanceVariance' > should flatten SlotAttendance docs & convert interval stringss to numbers
✅ Selectors -> > Test 'getMonthAttendanceVariance' > should collect attendance by customer
✅ Selectors -> > Test 'getMonthAttendanceVariance' > should format CustomerAttendanceRecords to TableData entries

✅ src/store/selectors/bookings/tests/bookings.test.ts

✅ Selectors -> > 'getSlotsForCustomer' >  > should get slots for a month with respect to 'startDate' and provided category
✅ Selectors -> > 'getSlotsForCustomer' >  > should display both "pre-competitive-adults" and "course-adults" slots to unsorted "adults" customers
✅ Selectors -> > 'getSlotsForCustomer' >  > should display slots with category "adults" to both "pre-competitive-adults" and "course-adults" customers
✅ Selectors -> > Test 'getCanBook' selector > should allow admin to book at all times
✅ Selectors -> > Test 'getCanBook' selector > should allow booking if the booking deadline hasn't passed
✅ Selectors -> > Test 'getCanBook' selector > should not allow booking if the booking deadline for the month is passed
✅ Selectors -> > Test 'getCanBook' selector > should allow booking if within extended date period
✅ Selectors -> > Test 'getCanBook' selector > should not allow booking if in extended date period, but extended date has passed
✅ Selectors -> > Test 'getCanBook' selector > edge case: should not allow booking if extended date exists for future month, but current month deadline has already passed
✅ Selectors -> > getShouldDisplayCountdown > should display countdown for currently observed month (based on redux date)
✅ Selectors -> > getShouldDisplayCountdown > should display countdown for second deadline if extended date belongs to observed month
✅ Selectors -> > getShouldDisplayCountdown > should not display any countdown for admin
✅ Selectors -> > getShouldDisplayCountdown > should display bookings are locked message (instead of countdown) if bookings for this period are locked
✅ Selectors -> > getMonthEmptyForBooking > should return true if there are no slots in a month
✅ Selectors -> > getMonthEmptyForBooking > should return true if there are slots in a month, but not of the required category
✅ Selectors -> > getMonthEmptyForBooking > should return false if there are slots available for booking in the required month for the required category
✅ Selectors -> > getBookingsForCalendar > should return a list of booked slots with corresponding booked interval and bookingNotes

✅ src/utils/tests/sort.test.ts

✅ Sort utils tests > Test 'comparePeriods' sorting > should return earlier periods first
✅ Sort utils tests > Test 'comparePeriods' sorting > should return longer periods first
✅ Sort utils tests > Test 'comparePeriods' sorting > start time should take presedence over interval length
✅ Sort utils tests > Test 'comparePeriods' sorting > should not explode when sorting two equal periods
✅ Sort utils tests > Test 'comparePeriods' sorting > Edge case: should return 0 if periods are the same (this will be used for composition of compare functions)
✅ Sort utils tests > Test 'compareCustomerNames' sorting > should sort by surname in ascending order
✅ Sort utils tests > Test 'compareCustomerNames' sorting > should sort by name if surname the same
✅ Sort utils tests > Test 'compareCustomerNames' sorting > should be case insensitive
✅ Sort utils tests > Test 'compareCustomerBookings' sorting > should sort by bookedInterval
✅ Sort utils tests > Test 'compareCustomerBookings' sorting > if bookedInterval the same, should sort aplhabetically

✅ src/utils/tests/utils.test.ts

✅ Helpers > `capitalizeFirst` function > should return passed string, with first letter capitalized
✅ Helpers > `capitalizeFirst` function > should capitalize all of the first letters for words divided by '-' sign
✅ Helpers > `convertIntervalToNum` function > should convert null to 0
✅ Helpers > `convertIntervalToNum` function > should convert string to number
✅ Date utils > 'luxon2ISODate' function > should return ISO date string with only date part (excluding time of day) from luxon date
✅ Date utils > 'isISO' function > should return 'true' if passed sring is a valid ISO date (yyyy-mm-dd) and 'false' otherwise
✅ Date utils > getOrgFromLocation > should split on the first double dash and return the first part
✅ Date utils > isEmpty > should return false on all defined, non-null primitive values
✅ Date utils > isEmpty > should return true on null and undefined
✅ Date utils > isEmpty > should return true empty arrays and objects and false on non-empty ones
✅ Date utils > `generateDatesInRange` function > should return a generator that yields all date strings within a range

Annotations

Check failure on line 0 in packages/client/junit.xml

See this annotation in the file changed.

@github-actions github-actions / Vitest report

src/__tests__/dataTriggers.test.ts ► Cloud functions -> Data triggers -> > createAttendanceForBooking > should create attendance entry for booking and not overwrite existing data in slot

Failed test found in:
  packages/client/junit.xml
Error:
  AssertionError: expected { date: '2021-03-01', …(1) } to deeply equal { date: '2021-03-01', …(1) }
Raw output
AssertionError: expected { date: '2021-03-01', …(1) } to deeply equal { date: '2021-03-01', …(1) }
 ❯ src/__tests__/dataTriggers.test.ts:77:31