test(work-orders): exercise reachable completion controls

This commit is contained in:
Alexandre Brandizzi 2026-09-29 19:10:46 -03:00
parent 5b4da11631
commit fdbb602e0c

View file

@ -284,7 +284,7 @@ test.describe("Inline technician registration", () => {
page,
}) => {
const writes: Captured[] = [];
await mockApi(page, writes);
await mockApi(page, writes, [{ ...BOARD_ROW, lifecycleStatusLabel: "In Progress" }]);
await page.goto("/workorders");
const row = page.locator("#wo-row-1");
@ -394,6 +394,7 @@ test.describe("Inline technician registration", () => {
const writes: Captured[] = [];
const unassigned = {
...BOARD_ROW,
lifecycleStatusLabel: "In Progress",
technicianAssigned: false,
techName: null,
techPhone: null,
@ -490,8 +491,11 @@ test.describe("Inline technician registration", () => {
await reloadedRow.getByRole("button", { name: "View details" }).click();
const reloadedDetails = page.getByRole("dialog", { name: "Work order details" });
await expect(reloadedDetails).toBeVisible();
await reloadedDetails.getByRole("button", { name: "Edit WO" }).click();
await reloadedDetails.getByRole("button", { name: /Vinewood LLC/ }).click();
await expect(reloadedDetails.getByRole("button", { name: "No technician" })).toBeVisible();
await expect(
page.getByRole("dialog").last().getByRole("button", { name: "No technician" }),
).toBeVisible();
});
test("cancelling the wizard after staging a technician writes no vendor (SH-366)", async ({