fix: invert name and surname in CheckboxCustomerList #4049
GitHub Actions / Vitest report
succeeded
May 16, 2024 in 0s
272 passed, 0 failed and 11 skipped
✅ packages/client/junit.xml
283 tests were completed in 62s with 272 passed, 0 failed and 11 skipped.
✅ src/tests/auth.test.ts
✅ Test authentication > Test queryAuthStatus > single secretKey: should successfully query customer status using email
✅ Test authentication > Test queryAuthStatus > multiple secretKeys: should return secretKeys for all customers with matching email
✅ Test authentication > Test queryAuthStatus > should reject if no 'organization' provided
✅ Test authentication > Test queryAuthStatus > should not explode if user is not logged in
✅ 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 > acceptPrivacyPolicy > should store the timestamp of confirmation to the customer's structure in the db
✅ Cloud functions > acceptPrivacyPolicy > should return an error if no payload provided
✅ Cloud functions > acceptPrivacyPolicy > should return an error if no organziation, id, secretKey or timestamp provided
✅ Cloud functions > acceptPrivacyPolicy > should return an error if customer id and secretKey mismatch
✅ Cloud functions > acceptPrivacyPolicy > 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 > create booking: interval only
✅ Cloud functions -> Data triggers -> > createAttendanceForBooking > create booking: interval with notes
✅ Cloud functions -> Data triggers -> > createAttendanceForBooking > update booking: interval only
✅ Cloud functions -> Data triggers -> > createAttendanceForBooking > update booking: interval with notes
✅ Cloud functions -> Data triggers -> > createAttendanceForBooking > update booking: notes only
✅ Cloud functions -> Data triggers -> > createAttendanceForBooking > remove booking notes
✅ Cloud functions -> Data triggers -> > createAttendanceForBooking > delete booking
✅ Cloud functions -> Data triggers -> > countSlotsBookings > should increment/decrement numBookings field in slotsByDay for the given slot
⚪ 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
✅ Cloud functions -> Data triggers -> > createCustomerStats > should update the customer doc with bookingStats with respect to customer's bookedSlots
✅ 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 > 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 '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 `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
✅ 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
✅ SendEmail > should use 'emailNameFrom' (if available in org setup) as 'from' attribute
✅ src/tests/sendSMS.test.ts
✅ SendSMS > should construct an email of type send-bookings-link and hand it over for delivery
✅ SendSMS > 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
✅ useModal hook > should call 'onClose' when the modal closes
✅ 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/hooks/tests/useBookingsDeadline.test.ts
✅ useBookingsDeadline > 'isBookingAllowed' > isAdmin = true, systemDate = 2021-03-01, currentDate = 2021-02, extendedDate = undefined
✅ useBookingsDeadline > 'isBookingAllowed' > isAdmin = false, systemDate = 2021-01-26, currentDate = 2021-02, extendedDate = undefined
✅ useBookingsDeadline > 'isBookingAllowed' > isAdmin = false, systemDate = 2021-01-27, currentDate = 2021-02, extendedDate = undefined
✅ useBookingsDeadline > 'isBookingAllowed' > isAdmin = false, systemDate = 2021-01-27, currentDate = 2021-02, extendedDate = 2021-01-30
✅ useBookingsDeadline > 'isBookingAllowed' > isAdmin = false, systemDate = 2021-01-31, currentDate = 2021-02, extendedDate = 2021-01-30
✅ useBookingsDeadline > 'isBookingAllowed' > isAdmin = false, systemDate = 2021-02-01, currentDate = 2021-02, extendedDate = 2021-02-22
✅ useBookingsDeadline > 'isBookingAllowed' > isAdmin = false, systemDate = 2021-01-27, currentDate = 2021-02, extendedDate = 2021-02-28
✅ useBookingsDeadline > 'countdownProps' > isAdmin = true, systemDate = 2021-03-01, currentDate = 2021-02, extendedDate = undefined
✅ useBookingsDeadline > 'countdownProps' > isAdmin = false, systemDate = 2021-01-26, currentDate = 2021-02, extendedDate = undefined
✅ useBookingsDeadline > 'countdownProps' > isAdmin = false, systemDate = 2021-01-27, currentDate = 2021-02, extendedDate = undefined
✅ useBookingsDeadline > 'countdownProps' > isAdmin = false, systemDate = 2021-01-27, currentDate = 2021-02, extendedDate = 2021-01-30
✅ useBookingsDeadline > 'countdownProps' > isAdmin = false, systemDate = 2021-01-31, currentDate = 2021-02, extendedDate = 2021-01-30
✅ 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
✅ Booking operations > 'acceptPrivacyPolicy' > should store timestamp of policy acceptance
✅ Booking operations > 'acceptPrivacyPolicy' > 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 > when customer is deleted, should mark them as deleted and clear out their categories and card number
✅ customerOperations > deleteCustomer > should not delete customer if the customer has bookings for a future date
✅ customerOperations > deleteCustomer > existing bookings shouldn't prevent customer from being deleted if all bookings dates are in the past
✅ 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
✅ Customer Selectors > Athletes approval > should get customers with no categories
✅ 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 'getSlotAttendance' > should handle missing 'slotId' in attendance
✅ Selectors -> > Test 'getSlotAttendance' > should return attendance for 'slotId'
✅ Selectors -> > Test 'getMonthAttendanceVariance'
✅ Selectors -> > Test 'getBookedIntervalsCustomers' > should return list of intervals as keys with customer names as value
✅ 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 filter out slots booked at full capacity
✅ Selectors -> > 'getSlotsForCustomer' > > should filter out slots booked at full capacity
✅ 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
✅ Selectors -> > getBookingsForCalendar > should sort the slots (by date, and by time intraday)
✅ 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
Loading