Skip to content

Commit

Permalink
fix: ability to click link on Danger button story
Browse files Browse the repository at this point in the history
  • Loading branch information
numbap committed Jun 26, 2023
1 parent 46c2edf commit e16502e
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/components/Button/Button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ import React from "react";
import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom/extend-expect";
import { axe, toHaveNoViolations } from "jest-axe";
import {
Primary,
Secondary,
DangerDisabled,
Link,
Supertask,
} from "./Button.stories";
import { Primary, Secondary, Danger, Link, Supertask } from "./Button.stories";

expect.extend(toHaveNoViolations);

Expand Down Expand Up @@ -43,10 +37,8 @@ describe("Button", () => {
});

it("renders danger", () => {
render(<DangerDisabled {...DangerDisabled.args} />);
expect(screen.getByRole("button")).toHaveTextContent(
DangerDisabled.args.text
);
render(<Danger {...Danger.args} />);
expect(screen.getByRole("button")).toHaveTextContent(Danger.args.text);
expect(screen.getByRole("button")).toHaveClass("ds-btn-danger");
});

Expand Down

0 comments on commit e16502e

Please sign in to comment.