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 <noreply@anthropic.com>
This commit is contained in:
NuklearRabbit
2026-08-03 22:05:50 +02:00
co-authored by Claude Sonnet 5
parent e6539d17b6
commit ac4b1636fe
+7 -3
View File
@@ -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();
});