Skip to content

Commit

Permalink
refactor(Badge.spec): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SutuSebastian committed Jan 17, 2025
1 parent 8636c2d commit 919c675
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/ui/src/components/Badge/Badge.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ describe("Components / Badge", () => {
it("should render", () => {
render(<Badge icon={HiCheck}>A badge</Badge>);

expect(link()).toBeInTheDocument();
expect(badge()).toBeInTheDocument();
});
});

describe("Classname", () => {
it("should merge not overwrite", () => {
render(<Badge className="bg-red-500">A badge with custom background</Badge>);

expect(badge()).toHaveClass(
"bg-red-500 text-cyan-800 dark:bg-cyan-200 dark:text-cyan-800 group-hover:bg-cyan-200 dark:group-hover:bg-cyan-300",
);
expect(badge()).toHaveClass("bg-red-500");
});
});

Expand Down Expand Up @@ -88,5 +86,3 @@ describe("Components / Badge", () => {
const badge = () => screen.getByTestId("flowbite-badge");

const icon = () => screen.getByTestId("flowbite-badge-icon");

const link = () => screen.getByRole("link");

0 comments on commit 919c675

Please sign in to comment.