mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
35dd86180b
Summary:
Accessibility service does not announce "selected" on accessibilityState = {selected: true} of the Button Component.
Issue link - https://github.com/facebook/react-native/issues/30956
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[General] [Added] - Add accessibilityState prop to Slider component
Pull Request resolved: https://github.com/facebook/react-native/pull/31145
Test Plan:
Verified accessibility states are read by voiceover and talkback. Some state values aren't handled by iOS and have been identified.
Added snapshot tests to test accessibilityState.disabled = disabled values
`js1 test Slider-test`
Reviewed By: yungsters
Differential Revision: D28337723
Pulled By: lunaleaps
fbshipit-source-id: 72a54d8d9dcf1fafb9785c81da99f32a21f3df00
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
* @format
|
|
*/
|
|
|
|
import * as React from 'react';
|
|
import ReactTestRenderer from 'react-test-renderer';
|
|
import Slider from '../Slider/Slider';
|
|
|
|
describe('<Slider />', () => {
|
|
it('should render as expected', () => {
|
|
expect(ReactTestRenderer.create(<Slider />)).toMatchSnapshot();
|
|
});
|
|
|
|
it('should set disabled as false', () => {
|
|
// Slider component should set disabled prop as false by default
|
|
expect(ReactTestRenderer.create(<Slider />)).toMatchSnapshot();
|
|
expect(
|
|
ReactTestRenderer.create(
|
|
<Slider accessibilityState={{disabled: false}} />,
|
|
),
|
|
).toMatchSnapshot();
|
|
});
|
|
it('should set disabled as true', () => {
|
|
expect(ReactTestRenderer.create(<Slider disabled />)).toMatchSnapshot();
|
|
expect(
|
|
ReactTestRenderer.create(
|
|
<Slider accessibilityState={{disabled: true}} />,
|
|
),
|
|
).toMatchSnapshot();
|
|
});
|
|
});
|