feat(ui): name controls and preserve modal state

This commit is contained in:
cesnimda
2026-09-11 19:31:32 +02:00
parent 682a3028bb
commit ebd4a3e245
52 changed files with 1366 additions and 42 deletions
@@ -30,7 +30,8 @@ describe.each(["light", "dark"] as const)("%s loaded company workflow", mode =>
if (outcome === "error") fail({ response: { status: 503 } });
else finish({ data: outcome === "empty" ? [] : [company] });
});
expect(screen.queryByRole("status")).not.toBeInTheDocument();
const status = screen.getByRole("status");
expect(status).toHaveTextContent(outcome === "error" ? "" : "Content loaded.");
if (outcome === "error") {
const error = screen.getByRole("alert");
expect(error).not.toBeEmptyDOMElement();
@@ -45,7 +46,8 @@ describe.each(["light", "dark"] as const)("%s loaded company workflow", mode =>
fireEvent.click(screen.getByRole("button", { name: `Edit: ${company.name}` }));
expect(screen.getByRole("dialog")).toHaveAccessibleName();
// Reading/editing a loaded form must not repeat the loading announcement or save.
expect(screen.queryByRole("status")).not.toBeInTheDocument();
expect(screen.getByRole("status", { hidden: true })).toBe(status);
expect(status).toHaveTextContent("Content loaded.");
} else {
expect(screen.getByRole("table")).toHaveTextContent("No companies");
}