From ade565cbca97f011335ef639d0458d024b936643 Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Mon, 13 Apr 2026 13:39:48 +0200 Subject: [PATCH] Introduce `completeBookingCreationFlow` utility and refactor booking flow tests: - Added `completeBookingCreationFlow` utility to streamline booking creation logic in `bookingFlow.ts`. - Refactored `userBookings.spec.ts` to replace inline booking creation steps with the new utility for improved readability and consistency. - Applied `data-testid` attributes across booking-related components for enhanced testability and test coverage. - Enhanced Playwright navigation error handling with `isBenignNavigationError` and `settleAuthenticatedNavigation` utilities to improve resilience and test robustness. --- .../department/pos/orders/ordersTable.vue | 13 +- .../PickCustomerInvoiceCollectionModal.vue | 4 +- .../displays/user/bookings/bookingsTable.vue | 10 +- .../displays/user/vehicles/vehiclesTable.vue | 58 +++-- .../Objects/CollectedOrderInvoices.vue | 2 +- .../token/SessionUser/Objects/Orders.vue | 6 +- .../modules/Pos/DepartmentPosOrder.vue | 220 +----------------- .../TimeBookingsElementSelectLocation.vue | 9 +- .../TimeBookingsElementSelectNotes.vue | 11 +- .../TimeBookingsElementSelectPoNumber.vue | 11 +- .../TimeBookingsElementSelectReference.vue | 11 +- .../userDashboard/bookings/MyBookingsBook.vue | 29 ++- .../userDashboard/profile/UserProfile.vue | 12 +- tests/e2e/admin-pos-orders.spec.ts | 97 ++++---- tests/e2e/change-invoice-collection.spec.ts | 107 ++++++++- tests/e2e/economic-queue-workflow.spec.js | 20 +- tests/e2e/fixtures/authHelpers.ts | 39 +++- tests/e2e/invoice-distribution.smoke.spec.js | 22 +- .../invoice-transfer-queue-history.spec.js | 20 +- tests/e2e/invoicing-period.smoke.spec.js | 17 +- tests/e2e/support/bookingFlow.ts | 124 ++++++++++ tests/e2e/support/network.js | 186 ++++++++++----- tests/e2e/twoFactorAuth.spec.ts | 33 ++- tests/e2e/user-orders.spec.ts | 23 +- tests/e2e/userAuth.spec.ts | 39 +++- tests/e2e/userBookWash.spec.ts | 79 +------ tests/e2e/userBookings.spec.ts | 61 +---- tests/e2e/userVehicles.spec.ts | 1 - 28 files changed, 726 insertions(+), 538 deletions(-) create mode 100644 tests/e2e/support/bookingFlow.ts diff --git a/src/components/displays/department/pos/orders/ordersTable.vue b/src/components/displays/department/pos/orders/ordersTable.vue index 3f14f5ac..de862343 100644 --- a/src/components/displays/department/pos/orders/ordersTable.vue +++ b/src/components/displays/department/pos/orders/ordersTable.vue @@ -1500,7 +1500,11 @@ const formatCashierName = (order) => { {{ SessionUser.objects.global.language.delete }} --> - + @@ -1556,7 +1560,12 @@ const formatCashierName = (order) => { @dismissed="isInvoiceMultipleCollectionsModalOpen = true" /> -