-
Notifications
You must be signed in to change notification settings - Fork 80
Improve a11y by using button with role switch #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,14 +23,6 @@ describe('rc-switch', () => { | |
| expect(switcher.state().checked).toBe(false); | ||
| }); | ||
|
|
||
| it('should toggle upon space and enter key', () => { | ||
| expect(switcher.state().checked).toBe(false); | ||
| switcher.simulate('keydown', { keyCode: 32 }); | ||
| expect(switcher.state().checked).toBe(true); | ||
| switcher.simulate('keydown', { keyCode: 13 }); | ||
| expect(switcher.state().checked).toBe(false); | ||
| }); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why remove this test case?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. enzyme doesn't fire onClick on such keypresses, but the browsers will call |
||
|
|
||
| it('should change from an initial checked state of true to false on click', () => { | ||
| const wrapper = mount(<Switch defaultChecked/>); | ||
| expect(wrapper.state().checked).toBe(true); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.