fix(ui): reconcile shared accessibility and read recovery
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user