Skip to content

Commit

Permalink
Fix skip link tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Aug 5, 2024
1 parent 342757f commit 8603ea0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Test.play = async ({ args, canvasElement }) => {
const $skipLink = canvas.getByText(args.text);
const $linkedElement = document.getElementById(args.href);

await expect($skipLink.getBoundingClientRect().width).toBe(1);
await expect($skipLink.getBoundingClientRect().height).toBe(1);
await expect($skipLink.getBoundingClientRect().width).toBe(11);
await expect($skipLink.getBoundingClientRect().height).toBe(11);
await expect($skipLink.getBoundingClientRect().x).toBeLessThanOrEqual(-1);
await expect($skipLink).not.toHaveFocus();
await expect($linkedElement).not.toHaveFocus();
Expand All @@ -63,8 +63,8 @@ Test.play = async ({ args, canvasElement }) => {
await expect($skipLink.getBoundingClientRect().x).toBeGreaterThanOrEqual(0);

await userEvent.click($skipLink);
await expect($skipLink.getBoundingClientRect().width).toBe(1);
await expect($skipLink.getBoundingClientRect().height).toBe(1);
await expect($skipLink.getBoundingClientRect().width).toBe(11);
await expect($skipLink.getBoundingClientRect().height).toBe(11);
await expect($skipLink.getBoundingClientRect().x).toBeLessThanOrEqual(-1);
await expect($skipLink).not.toHaveFocus();
await expect($linkedElement).toHaveAttribute("tabindex");
Expand Down

0 comments on commit 8603ea0

Please sign in to comment.