-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #468 from bcgov/feature/bump-react-component-libra…
…ry-deps Bump React component library dependencies
- Loading branch information
Showing
6 changed files
with
1,315 additions
and
1,250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/react-components/src/components/ButtonGroup/ButtonGroup.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import "@testing-library/jest-dom"; | ||
import { render, screen } from "@testing-library/react"; | ||
|
||
import ButtonGroup from "./ButtonGroup"; | ||
|
||
describe("ButtonGroup", () => { | ||
render(<ButtonGroup data-testid="button-group" />); | ||
render( | ||
<ButtonGroup data-testid="orientation-vertical" orientation="vertical" /> | ||
); | ||
render(<ButtonGroup data-testid="alignment-end" alignment="end" />); | ||
render(<ButtonGroup data-testid="alignment-center" alignment="center" />); | ||
const defaultButtonGroup = screen.getByTestId("button-group"); | ||
const verticalButtonGroup = screen.getByTestId("orientation-vertical"); | ||
const endButtonGroup = screen.getByTestId("alignment-end"); | ||
const centerButtonGroup = screen.getByTestId("alignment-center"); | ||
|
||
it("has default classes", () => { | ||
expect(defaultButtonGroup).toHaveClass("bcds-ButtonGroup horizontal start"); | ||
}); | ||
it("has the role='group' attribute", () => { | ||
expect(defaultButtonGroup).toHaveAttribute("role", "group"); | ||
}); | ||
it("passing orientation adds the correct class", () => { | ||
expect(verticalButtonGroup).toHaveClass("bcds-ButtonGroup vertical start"); | ||
}); | ||
it("passing 'end' alignment adds the correct class", () => { | ||
expect(endButtonGroup).toHaveClass("bcds-ButtonGroup horizontal end"); | ||
}); | ||
it("passing 'center' alignment adds the correct class", () => { | ||
expect(centerButtonGroup).toHaveClass("bcds-ButtonGroup horizontal center"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters