|
7 | 7 | TouchableOpacity,
|
8 | 8 | TouchableWithoutFeedback,
|
9 | 9 | View,
|
| 10 | + Switch, |
10 | 11 | } from 'react-native';
|
11 | 12 | import { render, screen } from '../..';
|
12 | 13 |
|
@@ -426,7 +427,7 @@ describe('supports accessibility states', () => {
|
426 | 427 | expect(screen.queryByRole('checkbox', { checked: 'mixed' })).toBe(null);
|
427 | 428 | });
|
428 | 429 |
|
429 |
| - it('returns `mixed` checkboxes', () => { |
| 430 | + test('returns `mixed` checkboxes', () => { |
430 | 431 | render(
|
431 | 432 | <TouchableOpacity accessibilityRole="checkbox" accessibilityState={{ checked: 'mixed' }} />,
|
432 | 433 | );
|
@@ -508,6 +509,14 @@ describe('supports accessibility states', () => {
|
508 | 509 | expect(screen.queryByRole('checkbox', { checked: false })).toBe(null);
|
509 | 510 | });
|
510 | 511 |
|
| 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 | + |
511 | 520 | test('supports aria-checked={true} prop', () => {
|
512 | 521 | render(<View accessible accessibilityRole="checkbox" aria-checked={true} />);
|
513 | 522 | expect(screen.getByRole('checkbox', { checked: true })).toBeTruthy();
|
|
0 commit comments