Add encoding repair utilities and tests:

- Introduced `repairText` and `containsSuspiciousEncoding` utilities for handling corrupted text encodings.
- Added unit tests (`encoding-repair.spec.js`) to validate encoding repair and encoding marker detection.
- Integrated encoding check into unit test workflows (`text:check-encoding` and `text:fix-encoding` scripts).
- Replaced corrupted strings across multiple components and locales with proper UTF-8 encodings.
This commit is contained in:
Jeppe Bundgaard
2026-04-21 10:24:35 +02:00
parent 1a784bbbfd
commit d7ff64bf4e
41 changed files with 2890 additions and 1283 deletions
+46
View File
@@ -1462,6 +1462,52 @@ test.describe("Admin POS wash certificate completion", () => {
await expect(safetySealInput).toHaveValue("SEAL-5566");
});
test("refreshes the attachments tab after regenerating a wash certificate from a safety seal edit", async ({
page,
}, testInfo) => {
test.skip(!testInfo.project.name.includes("desktop"), "Desktop-only wash certificate refresh coverage");
await mockApi(page, {
authenticated: true,
permissions: POS_PERMISSIONS,
edgeGateways: false,
pos: createPosFixture(),
});
await primeOperatorSession(page, "pos-safety-seal-refresh-token");
await openOrderAttachments(page);
await openAddAttachmentCard(page);
const attachWashCertificateButton = page.getByTestId("pos-order-attachments-attach-wash-certificate");
await attachWashCertificateButton.click();
await expect(page.locator(".swal2-popup")).toBeVisible();
await page.locator(".swal2-input").fill("SEAL-INITIAL");
await page.locator(".swal2-confirm").click();
await expect(page.getByTestId("pos-order-attachment-card-400")).toBeVisible();
await waitForSwalToClose(page);
await clickVisibleTestId(page, "pos-order-tab-cart");
await expect(page.getByTestId("pos-order-panel-cart")).toBeVisible();
const updateRequest = waitForOrderMutation(
page,
"PUT",
"/orders",
(body) => Number(body.id) === 54518 && body.safety_seal === "SEAL-UPDATED"
);
await page.getByTestId("pos-order-customer-wishes-safety-seal").click();
const safetySealInput = page.getByTestId("pos-order-customer-wishes-safety-seal-input");
await expect(safetySealInput).toBeVisible();
await safetySealInput.fill("SEAL-UPDATED");
await updateRequest;
await clickVisibleTestId(page, "pos-order-tab-attachments");
await expect(page.getByTestId("pos-order-panel-attachments")).toBeVisible();
await expect(page.getByTestId("pos-order-attachment-card-401")).toBeVisible({ timeout: 10_000 });
await expect(page.getByTestId("pos-order-attachment-card-400")).toHaveCount(0);
});
test("defers material desktop completion to step 4 and auto-attaches the wash certificate on final completion", async ({
page,
}, testInfo) => {