Refactor module paths, layout responsiveness, and testing configurations:
- Replaced repetitive department module URL logic with `buildDepartmentModulePath` utility in `DepartmentModulesDisplay.vue`. - Enhanced layouts and responsive behavior across components, including `PosDepartmentStep1MobileTransactionHistory.vue` and `DepartmentDailyReport.vue`. - Removed unused `SuperuserInvoicingLocalStore.vue` and refactored to `SuperuserInvoicingLocalStore.ts`. - Updated media query handling and card layout adjustments in `DepartmentDailyReport.vue`. - Added new Playwright configurations (`playwright.prod.config.ts` and `playwright.live.config.ts`) for e2e release workflows. - Extended e2e and unit test coverage for mobile POS and department modules.
This commit is contained in:
@@ -184,10 +184,67 @@ test.describe("POS mobile order flow", () => {
|
||||
await expectHorizontallyCentered(page.getByTestId("pos-mobile-step-1-shell"), page.getByTestId("pos-mobile-step-1-subtitle"));
|
||||
await expectHorizontallyCentered(page.getByTestId("pos-mobile-step-1-shell"), page.getByTestId("pos-mobile-manual-input-toggle"));
|
||||
|
||||
const [registrationRowBox, referenceTriggerBox] = await Promise.all([
|
||||
page.getByTestId("pos-mobile-step-1-registration-row").boundingBox(),
|
||||
page.getByTestId("pos-mobile-step-1-reference-trigger").boundingBox(),
|
||||
]);
|
||||
|
||||
expect(registrationRowBox).not.toBeNull();
|
||||
expect(referenceTriggerBox).not.toBeNull();
|
||||
expect(Math.abs((registrationRowBox?.width ?? 0) - (referenceTriggerBox?.width ?? 0))).toBeLessThanOrEqual(4);
|
||||
expect(Math.abs((registrationRowBox?.x ?? 0) - (referenceTriggerBox?.x ?? 0))).toBeLessThanOrEqual(4);
|
||||
|
||||
await page.getByTestId("pos-mobile-next-step").click();
|
||||
await expect(page.getByTestId("pos-mobile-customer-popup")).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
test("transaction history keeps each wash visually separated with a border", async ({ page }) => {
|
||||
const fixture = createMobilePosFixture({
|
||||
ordersById: {
|
||||
9201: buildRegularOrder(9201, {
|
||||
customer_name: "VOGNMAND JIMMY CHRISTENSEN ApS",
|
||||
total_net_amount: 746,
|
||||
pending_handheld: true,
|
||||
created_at: "2026-04-09T12:08:00.000Z",
|
||||
}),
|
||||
9202: buildRegularOrder(9202, {
|
||||
customer_name: "BYGMA Roskilde A/S",
|
||||
total_net_amount: 507,
|
||||
pending_handheld: true,
|
||||
created_at: "2026-04-09T11:51:00.000Z",
|
||||
}),
|
||||
9203: buildRegularOrder(9203, {
|
||||
customer_name: "VOLVO ENTREPRENØRMASKINER A/S",
|
||||
total_net_amount: 512,
|
||||
pending_handheld: true,
|
||||
created_at: "2026-04-09T10:10:00.000Z",
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
await setupMobilePosPage(page, fixture, {
|
||||
token: "mobile-transaction-history-token",
|
||||
seedState: {
|
||||
customerId: null,
|
||||
reg: "FREE123",
|
||||
reference: "HISTORY-REF",
|
||||
includePrimaryItem: false,
|
||||
vehicleType: null,
|
||||
lastOrderId: null,
|
||||
transactionHistoryView: true,
|
||||
},
|
||||
route: {
|
||||
step: 1,
|
||||
},
|
||||
});
|
||||
|
||||
const cards = page.locator('[data-testid^="pos-mobile-transaction-history-card-"]');
|
||||
await expect(cards.first()).toBeVisible({ timeout: 10_000 });
|
||||
expect(await cards.count()).toBe(3);
|
||||
await expect(cards.first()).toHaveCSS("border-top-style", "solid");
|
||||
await expect(cards.first()).toHaveCSS("border-top-width", "1px");
|
||||
});
|
||||
|
||||
test("customer notes popup shows the translated created-by label", async ({ page }) => {
|
||||
const fixture = createMobilePosFixture({
|
||||
customerNotesByNumber: {
|
||||
@@ -224,6 +281,17 @@ test.describe("POS mobile order flow", () => {
|
||||
});
|
||||
|
||||
await expect(page.getByTestId("pos-mobile-customer-notes-trigger")).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
const [registrationRowBox, notesTriggerBox] = await Promise.all([
|
||||
page.getByTestId("pos-mobile-step-1-registration-row").boundingBox(),
|
||||
page.getByTestId("pos-mobile-customer-notes-trigger").boundingBox(),
|
||||
]);
|
||||
|
||||
expect(registrationRowBox).not.toBeNull();
|
||||
expect(notesTriggerBox).not.toBeNull();
|
||||
expect(Math.abs((registrationRowBox?.width ?? 0) - (notesTriggerBox?.width ?? 0))).toBeLessThanOrEqual(4);
|
||||
expect(Math.abs((registrationRowBox?.x ?? 0) - (notesTriggerBox?.x ?? 0))).toBeLessThanOrEqual(4);
|
||||
|
||||
await page.getByTestId("pos-mobile-customer-notes-trigger").click();
|
||||
|
||||
const popup = page.locator('[data-testid="pos-mobile-popup"][data-popup-id="customer_notes"]');
|
||||
|
||||
Reference in New Issue
Block a user