Skip to content

Commit c225b1d

Browse files
committed
chore: more tests
1 parent 35937d3 commit c225b1d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/queries/__tests__/role.test.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
TouchableOpacity,
88
TouchableWithoutFeedback,
99
View,
10+
Switch,
1011
} from 'react-native';
1112
import { render, screen } from '../..';
1213

@@ -426,7 +427,7 @@ describe('supports accessibility states', () => {
426427
expect(screen.queryByRole('checkbox', { checked: 'mixed' })).toBe(null);
427428
});
428429

429-
it('returns `mixed` checkboxes', () => {
430+
test('returns `mixed` checkboxes', () => {
430431
render(
431432
<TouchableOpacity accessibilityRole="checkbox" accessibilityState={{ checked: 'mixed' }} />,
432433
);
@@ -508,6 +509,14 @@ describe('supports accessibility states', () => {
508509
expect(screen.queryByRole('checkbox', { checked: false })).toBe(null);
509510
});
510511

512+
test('supports "Switch" component', () => {
513+
render(<Switch value={true} />);
514+
515+
expect(screen.getByRole('switch', { checked: true })).toBeTruthy();
516+
expect(screen.queryByRole('switch', { checked: false })).toBe(null);
517+
expect(screen.queryByRole('switch', { checked: 'mixed' })).toBe(null);
518+
});
519+
511520
test('supports aria-checked={true} prop', () => {
512521
render(<View accessible accessibilityRole="checkbox" aria-checked={true} />);
513522
expect(screen.getByRole('checkbox', { checked: true })).toBeTruthy();

0 commit comments

Comments
 (0)