Skip to content

Commit

Permalink
chore(Button): adding special tests for the new spacing feature (#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
aversini authored Dec 29, 2024
1 parent 0d79337 commit b7482b8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/ui-button/src/components/Button/__tests__/Button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ describe("Button (exceptions)", () => {
});
});

describe("Button spacing", () => {
it("should render a button with a right margin spacing", async () => {
render(<Button className="mr-2">hello</Button>);
const button = await screen.findByRole("button");
// not only it should be there, but it should be the last entry
expect(button.className).toContain("mr-2");
expect(button.className.slice(-4)).toBe("mr-2");
});
});

describe("Button modifiers", () => {
it("should render a default button", async () => {
render(<Button>hello</Button>);
Expand Down

0 comments on commit b7482b8

Please sign in to comment.