diff --git a/src/components/Form/Controls/EditInPlace/__snapshots__/EditInPlace.test.tsx.snap b/src/components/Form/Controls/EditInPlace/__snapshots__/EditInPlace.test.tsx.snap index bc715a5c..83b5aa4f 100644 --- a/src/components/Form/Controls/EditInPlace/__snapshots__/EditInPlace.test.tsx.snap +++ b/src/components/Form/Controls/EditInPlace/__snapshots__/EditInPlace.test.tsx.snap @@ -10,7 +10,7 @@ exports[`EditInPlace > disables control when disabled 1`] = ` > Edit Me @@ -20,7 +20,7 @@ exports[`EditInPlace > disables control when disabled 1`] = ` @@ -40,7 +40,7 @@ exports[`EditInPlace > displays saved label for 2 seconds after save 1`] = ` > Edit Me @@ -49,7 +49,7 @@ exports[`EditInPlace > displays saved label for 2 seconds after save 1`] = ` > @@ -71,7 +71,7 @@ exports[`EditInPlace > displays saved label for 2 seconds after save 2`] = ` Edit Me @@ -79,11 +79,11 @@ exports[`EditInPlace > displays saved label for 2 seconds after save 2`] = ` class="_controls_980156" > @@ -92,7 +92,7 @@ exports[`EditInPlace > displays saved label for 2 seconds after save 2`] = ` > displays saved label for 2 seconds after save 2`] = ` displays saved label for 2 seconds after save 2`] = ` displays saved label for 2 seconds after save 3`] = ` Edit Me @@ -186,17 +186,17 @@ exports[`EditInPlace > displays saved label for 2 seconds after save 3`] = ` class="_controls_980156" > renders error icon and text if passed as children 1`] = ` Edit Me @@ -265,11 +265,11 @@ exports[`EditInPlace > renders error icon and text if passed as children 1`] = ` class="_controls_980156" > @@ -278,7 +278,7 @@ exports[`EditInPlace > renders error icon and text if passed as children 1`] = ` > renders error icon and text if passed as children 1`] = ` renders error icon and text if passed as children 1`] = ` uses native form validation logic 1`] = ` > Edit Me @@ -367,7 +367,7 @@ exports[`EditInPlace > uses native form validation logic 1`] = ` > uses the custom error messages passed as children 1`] = ` > Edit Me @@ -398,7 +398,7 @@ exports[`EditInPlace > uses the custom error messages passed as children 1`] = ` > diff --git a/src/components/Tooltip/Tooltip.test.tsx b/src/components/Tooltip/Tooltip.test.tsx index b935b925..45520d14 100644 --- a/src/components/Tooltip/Tooltip.test.tsx +++ b/src/components/Tooltip/Tooltip.test.tsx @@ -108,18 +108,20 @@ describe("Tooltip", () => { const user = userEvent.setup(); render(); await user.tab(); - // tooltip labels button, opens, and displays caption - screen.getByRole("button", { name: /I can have a caption/ }); - screen.getByText("My beautiful caption"); + // tooltip labels button and describes button with caption + expect( + screen.getByRole("button", { name: "I can have a caption" }), + ).toHaveAccessibleDescription("My beautiful caption"); }); it("renders with component caption", async () => { const user = userEvent.setup(); render(); await user.tab(); - // tooltip labels button, opens, and displays caption - screen.getByRole("button", { name: /Copy/ }); - screen.getByText("Ctrl"); + // tooltip labels button and describes button with caption + expect( + screen.getByRole("button", { name: "Copy" }), + ).toHaveAccessibleDescription("Ctrl + C"); }); it("renders a descriptive tooltip", async () => { diff --git a/src/components/Tooltip/Tooltip.tsx b/src/components/Tooltip/Tooltip.tsx index a8e59c32..35ebdac8 100644 --- a/src/components/Tooltip/Tooltip.tsx +++ b/src/components/Tooltip/Tooltip.tsx @@ -137,8 +137,6 @@ function TooltipContent({ ({ - contentId, labelId, captionId: caption ? captionId : undefined, caption,