Skip to content

Commit

Permalink
chore: Merge master into prerelease/minor [skip release]
Browse files Browse the repository at this point in the history
  • Loading branch information
alanbsmith committed Sep 6, 2023
2 parents 9304dd5 + 81c6c52 commit c78bbce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/Switch.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as h from '../helpers';

const getSwitch = () => {
return cy.findByRole('checkbox');
return cy.findByRole('switch');
};

describe('Switch', () => {
Expand Down
3 changes: 1 addition & 2 deletions modules/react/switch/lib/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ export const Switch = createComponent('input')({
id={inputId}
ref={ref}
onChange={onChange}
role="checkbox"
tabIndex={0}
role="switch"
type="checkbox"
value={value}
{...elemProps}
Expand Down
10 changes: 1 addition & 9 deletions modules/react/switch/spec/Switch.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ import {Switch} from '../lib/Switch';
describe('Switch', () => {
const cb = jest.fn();

/**
* Today, this is hardcoded but this could possibly be
* configurable in the future (e.g. role='switch').
* In fact, 'checkbox' probably isn't the correct role
* according to MDN and ARIA
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Switch_role
* https://www.w3.org/TR/wai-aria-1.1/#switch
*/
const role = 'checkbox';
const role = 'switch';

afterEach(() => {
cb.mockClear();
Expand Down

0 comments on commit c78bbce

Please sign in to comment.