-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Radio): Add snapshots and solve storybook issues DEV-136
- Loading branch information
1 parent
8ab1d2f
commit 576130b
Showing
5 changed files
with
47 additions
and
1 deletion.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { render } from "../../tests/utils" | ||
import Radio from "../Radio/Radio" | ||
import { axe } from "jest-axe" | ||
|
||
describe("Radio Group", () => { | ||
test("renders correctly", async () => { | ||
const onChange = jest.fn() | ||
const { getByLabelText } = render( | ||
<Radio.Group | ||
name="RADIO_NAME" | ||
value="RADIO_GROUP_VALUE" | ||
onChange={onChange} | ||
> | ||
<Radio value="value 1" label="OPTION_Y" /> | ||
<Radio value="value 2" label="OPTION_X" /> | ||
</Radio.Group> | ||
) | ||
|
||
expect(getByLabelText("OPTION_Y")).toBeInTheDocument() | ||
}) | ||
|
||
test("passes a11y check", async () => { | ||
// Arrange | ||
const onChange = jest.fn() | ||
const { container } = render( | ||
<Radio.Group name="inputGroup" value="SOME_VALUE" onChange={onChange}> | ||
<Radio value="value 1" label="Option Y" /> | ||
<Radio value="value 2" label="Option X" /> | ||
</Radio.Group> | ||
) | ||
const results = await axe(container) | ||
|
||
// Assert | ||
expect(results).toHaveNoViolations() | ||
}) | ||
}) |
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
Binary file added
BIN
+1.13 KB
...toryshots-test-ts-image-storyshots-design-system-radio-group-example-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.