Skip to content
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

Add Testing for accessibilityValue and Implement IValueProvider conditionally #13544

Merged
merged 19 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Adjust Support for IValueProvider",
"packageName": "react-native-windows",
"email": "34109996+chiaramooney@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,11 @@ exports.examples = [
testID="accessibility_props"
title="Submit Application"
accessibilityLabel="Press to submit your application!"
accessibilityRole="Button"
accessibilityRole="button"
accessibilityHint="Submit Button"
accessibilityPosInSet={1}
accessibilitySetSize={1}
accessibilityValue={{Text: "Submit Application"}}
/>
);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ function PressableFeedbackEvents() {
testID="pressable_feedback_events_button"
accessibilityLabel="pressable feedback events"
accessibilityRole="button"
accessibilityValue={{text: "Press Me"}}
// [Windows
onFocus={() => appendEvent('focus')}
onBlur={() => appendEvent('blur')}
Expand Down Expand Up @@ -959,7 +960,7 @@ const examples = [
onPress={() => {}}
importantForAccessibility="no-hide-descendants"
accessibilityHint="Button"
accessibilityValue={0}>
accessibilityValue={{text: "Child Pressable"}}>
<Text>Parent Pressable</Text>
<Pressable onPress={() => {}}>
<Text>Child Pressable</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,20 @@ const examples: Array<RNTesterModuleExample> = [
);
},
},
{
title: 'Searchbox',
render: function (): React.Node {
return (
<View accessible testID="textinput-searchbox">
<ExampleTextInput
style={styles.singleLine}
accessibilityRole="searchbox"
defaultValue="Search"
/>
</View>
);
},
},
// Windows]
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class TouchableFeedbackEvents extends React.Component<{...}, $FlowFixMeState> {
testID="touchable_feedback_events_button"
accessibilityLabel="touchable feedback events"
accessibilityRole="button"
accessibilityValue={{text: "Press Me"}}
onPress={() => this._appendEvent('press')}
onPressIn={() => this._appendEvent('pressIn')}
onPressOut={() => this._appendEvent('pressOut')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ class AccessibilityExample extends React.Component<
accessibilityLabel="A View with accessibility values"
accessibilityHint="Accessibility Hint"
accessibilityRole="button"
accessibilityValue={0}
accessibilityValue={{now: this.state.tap}}
accessibilityActions={[
{name: 'cut', label: 'cut'},
{name: 'copy', label: 'copy'},
Expand Down Expand Up @@ -503,6 +503,9 @@ class AccessibilityExample extends React.Component<
<View importantForAccessibility="no-hide-descendants">
<Text>This element should be hidden from accessibility.</Text>
</View>
<View accessible accessibilityValue={{now: this.state.tap}}>
<Text>This sub-view should not have an accessibility value. It's control type does not support the value pattern.</Text>
</View>
</View>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,4 +803,10 @@ describe('TextInput Tests', () => {
const dump = await dumpVisualTree('textinput-cursorColor');
expect(dump).toMatchSnapshot();
});
test('TextInputs which have a searchbox role should also support the value pattern.', async () => {
const component = await app.findElementByTestID('textinput-searchbox');
await component.waitForDisplayed({timeout: 5000});
const dump = await dumpVisualTree('textinput-searchbox');
expect(dump).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9627,6 +9627,7 @@ exports[`Home UIA Tree Dump Search Bar 1`] = `
"IsKeyboardFocusable": true,
"LocalizedControlType": "edit",
"Name": "Search...",
"ValuePattern.IsReadOnly": false,
},
"Component Tree": {
"Type": "Microsoft.ReactNative.Composition.WindowsTextInputComponentView",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ exports[`Pressable Tests Pressables can have event handlers 1`] = `
"IsKeyboardFocusable": true,
"LocalizedControlType": "button",
"Name": "pressable feedback events",
"ValuePattern.Value": "Press Me",
"__Children": [
{
"AutomationId": "",
Expand Down
Loading