fix(ui): reconcile shared accessibility and read recovery

This commit is contained in:
cesnimda
2026-10-20 20:26:48 +02:00
parent bba52af4b8
commit d8c0187305
25 changed files with 802 additions and 25 deletions
@@ -122,6 +122,20 @@ test("reordering sends the new id order", async () => {
expect(mockedApi.put).toHaveBeenCalledWith("/jobapplications/7/checklist/order", [2, 1, 3]));
});
test("move and remove tooltips describe their wrappers without replacing item-specific button names", async () => {
mockedApi.patch.mockReturnValueOnce(new Promise(() => {}));
renderChecklist();
const down = await screen.findByRole("button", { name: "Move down: Prepare a CV for this role" });
for (const label of ["Move up: Prepare a CV for this role", "Move down: Prepare a CV for this role", "Remove: Prepare a CV for this role"]) {
expect(screen.getByRole("button", { name: label }).parentElement).not.toHaveAttribute("aria-label");
}
fireEvent.click(screen.getByRole("checkbox", { name: "Prepare a CV for this role" }));
expect(down).toBeDisabled();
fireEvent.mouseOver(down.parentElement!);
expect(await screen.findByRole("tooltip")).toHaveTextContent("Move down");
expect(mockedApi.put).not.toHaveBeenCalled();
});
test("removing an item calls delete", async () => {
mockedApi.delete.mockResolvedValue({ data: undefined } as any);