Skip to content

Commit

Permalink
Fix interaction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jandrade committed Nov 15, 2023
1 parent 44bfcb5 commit 14eba89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions __docs__/wonder-blocks-button/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const Tertiary: StoryComponentType = {

// Get HTML elements
const button = canvas.getByRole("button");
const computedStyleButton = getComputedStyle(button, ":after");
const computedStyleButton = getComputedStyle(button);
const innerLabel = canvas.getByTestId("test-button-inner-label");
const computedStyleLabel = getComputedStyle(innerLabel, ":after");

Expand All @@ -120,8 +120,10 @@ export const Tertiary: StoryComponentType = {

// Focus style
await fireEvent.focus(button);
await expect(computedStyleButton.borderColor).toBe("rgb(24, 101, 242)");
await expect(computedStyleButton.borderWidth).toBe("2px");
await expect(computedStyleButton.outlineColor).toBe(
"rgb(24, 101, 242)",
);
await expect(computedStyleButton.outlineWidth).toBe("2px");

// Active (mouse down) style
// eslint-disable-next-line testing-library/prefer-user-event
Expand Down

0 comments on commit 14eba89

Please sign in to comment.