Replace legacy Tooltips with Compound tooltips (#28231)

* Ditch legacy Tooltips in favour of Compound

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove dead code

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Extract markdown CodeBlock into React component

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Upgrade compound

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2024-10-18 14:57:39 +00:00
committed by GitHub
parent fad457362d
commit 26430a3a6a
29 changed files with 410 additions and 670 deletions
@@ -57,12 +57,12 @@ describe("Field", () => {
// When invalid
fireEvent.focus(screen.getByRole("textbox"));
// Expect 'alert' role
await expect(screen.findByRole("alert")).resolves.toBeInTheDocument();
// Expect 'aria-live=assertive'
await expect(screen.findByRole("tooltip")).resolves.toHaveAttribute("aria-live", "assertive");
// Close the feedback is Escape is pressed
fireEvent.keyDown(screen.getByRole("textbox"), { key: "Escape" });
expect(screen.queryByRole("alert")).toBeNull();
expect(screen.queryByRole("tooltip")).not.toBeInTheDocument();
});
it("Should mark the feedback as status if valid", async () => {
@@ -77,12 +77,12 @@ describe("Field", () => {
// When valid
fireEvent.focus(screen.getByRole("textbox"));
// Expect 'status' role
await expect(screen.findByRole("status")).resolves.toBeInTheDocument();
// Expect 'aria-live=polite' role
await expect(screen.findByRole("tooltip")).resolves.toHaveAttribute("aria-live", "polite");
// Close the feedback is Escape is pressed
fireEvent.keyDown(screen.getByRole("textbox"), { key: "Escape" });
expect(screen.queryByRole("status")).toBeNull();
expect(screen.queryByRole("tooltip")).not.toBeInTheDocument();
});
it("Should mark the feedback as tooltip if custom tooltip set", async () => {