test(ui): require accessible company save errors
This commit is contained in:
@@ -93,13 +93,11 @@ for (const [mode, language, width] of [["light", "en", 1440], ["dark", "nb", 144
|
||||
await companyDialog.getByRole("textbox", { name: t.companiesRecruiterName, exact: true }).fill("Retained æøå draft");
|
||||
await page.route(`${apiUrl}/companies/${owner.companyId}`, route => route.request().method() === "PUT" ? route.fulfill({ status: 503, contentType: "application/json", body: JSON.stringify({ message: "Synthetic save failure" }) }) : route.continue());
|
||||
await companyDialog.getByRole("button", { name: t.save, exact: true }).click();
|
||||
// Existing P4-02-D02: this caller reports save errors in the shared toast,
|
||||
// outside the modal's accessible subtree. Preserve the draft proof while
|
||||
// recording the hidden-alert defect instead of claiming an AT error pass.
|
||||
const saveError = page.getByRole("alert", { includeHidden: true }).filter({ hasText: "Synthetic save failure" });
|
||||
// P6 closes P4-02-D02: the retained draft's error belongs to the dialog.
|
||||
const saveError = companyDialog.getByRole("alert");
|
||||
await expect(saveError).toContainText("Synthetic save failure");
|
||||
await expect(saveError).toBeVisible();
|
||||
expect(await saveError.evaluate(node => !!node.closest('[aria-hidden="true"]'))).toBe(true);
|
||||
expect(await saveError.evaluate(node => !!node.closest('[aria-hidden="true"]'))).toBe(false);
|
||||
await expect(companyDialog.getByRole("textbox", { name: t.companiesRecruiterName, exact: true })).toHaveValue("Retained æøå draft");
|
||||
expect(await statusNode!.getAttribute("data-test-announcements")).toBeNull();
|
||||
await capture(page, info, `retained-draft-${suffix}`);
|
||||
|
||||
Reference in New Issue
Block a user