From ac4b1636fee09a40c7fead35138cbbee29ca91f6 Mon Sep 17 00:00:00 2001 From: NuklearRabbit <145918611+NuklearRabbit@users.noreply.github.com> Date: Mon, 3 Aug 2026 22:05:50 +0200 Subject: [PATCH] test: update Playwright specs for the new status-recommendation flow and localized return reason Two specs still exercised the old single-button "calculate and apply" flow and asserted on the raw English return-status reason that is now shown as localized primary text with the raw code moved behind "Technical details". Updated both to match the new review/decide/confirm status panel and the reason-code UI. Full 94-test Playwright suite green against the rebuilt web+api stack. Co-Authored-By: Claude Sonnet 5 --- frontend/e2e/interactive-elements.spec.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/e2e/interactive-elements.spec.ts b/frontend/e2e/interactive-elements.spec.ts index a00160c..c771b80 100644 --- a/frontend/e2e/interactive-elements.spec.ts +++ b/frontend/e2e/interactive-elements.spec.ts @@ -130,9 +130,13 @@ test("return preview correctly reports blocked (not maintenance) for damage repo // The preview is the server's authoritative evaluation: damage always routes to // "blocked", never "maintenance" -- this used to be guessed client-side and wrong. - await expect(page.getByText("Damage was reported on return.")).toBeVisible(); + // The localized reason is the primary text; the raw code sits behind "Technical + // details" so it isn't visible until expanded. + await expect(page.getByText("Damage was reported on this return.")).toBeVisible(); const statusRegion = page.locator(".impact-preview"); await expect(statusRegion.getByText("blocked", { exact: true })).toBeVisible(); + await page.getByText("Technical details").click(); + await expect(page.getByText("Damage was reported on return.")).toBeVisible(); }); test("data quality page: status and rule-type filters work", async ({ page }) => { @@ -201,8 +205,8 @@ test("data quality: applying the recommended status resolves a vehicle conflict" await page.goto("/data-quality/DQ-DEMO-STATUS"); await expect(page.getByRole("heading", { name: "DQ-DEMO-STATUS" })).toBeVisible(); - await page.getByRole("button", { name: "Calculate and apply recommended status" }).click(); - await page.getByRole("button", { name: "Yes, apply" }).click(); + await page.getByRole("button", { name: "Review recommendation" }).click(); + await page.getByRole("button", { name: /^Change status to/ }).click(); await expect(page.getByText("Applied", { exact: false })).toBeVisible(); });