Add e2e and unit tests for i18n coverage and POS workflows:

- Introduced i18n key usage validation with `tests/e2e/i18n.views.spec.ts` for deterministic locale coverage.
- Added `viewI18nKeyScanner` utility to scan and validate view translation keys.
- Created `PosDepartmentStep1` unit tests for duplicate warnings and booking selection flow.
- Enhanced POS mobile popup with `SelectOrderBookingPopupProps` and new header close options.
- Updated e2e tests with scenarios to verify booking selections, duplicate handling, and locale alignment.
- Added new `test:e2e:i18n:views` npm script for targeted i18n test execution.
This commit is contained in:
Jeppe Bundgaard
2026-04-14 10:49:20 +02:00
parent 7533622fb1
commit a4676f8f87
30 changed files with 2360 additions and 383 deletions
+18
View File
@@ -1203,7 +1203,25 @@ test.describe("Admin POS wash certificate completion", () => {
await openOrderDetail(page);
const safetySealField = page.getByTestId("pos-order-customer-wishes-safety-seal");
const referenceControl = page.getByTestId("pos-order-customer-wishes-reference-control");
const poControl = page.getByTestId("pos-order-customer-wishes-po-control");
const safetySealControl = page.getByTestId("pos-order-customer-wishes-safety-seal-control");
await expect(safetySealField).toBeVisible();
await expect(referenceControl).toBeVisible();
await expect(poControl).toBeVisible();
await expect(safetySealControl).toBeVisible();
const [referenceBox, poBox, safetySealBox] = await Promise.all([
referenceControl.boundingBox(),
poControl.boundingBox(),
safetySealControl.boundingBox(),
]);
expect(referenceBox).not.toBeNull();
expect(poBox).not.toBeNull();
expect(safetySealBox).not.toBeNull();
expect(safetySealBox!.width).toBeGreaterThan(referenceBox!.width * 1.8);
expect(safetySealBox!.width).toBeGreaterThan(poBox!.width * 1.8);
const updateRequest = waitForOrderMutation(
page,