-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
toHaveToggleValue() fails with RN73 #4639
Comments
Heavy debugging shows that for toggles based on non-switch components (as in <TouchableOpacity {...this.getAccessibilityProps()} {...props} onPress={this.onPress}>
{this.renderToggle()}
</TouchableOpacity>
// where getAccessibilityProps is something like:
getAccessibilityProp() {
return {
accessible: true,
accessibilityRole: 'switch',
accessibilityState: {
disabled,
checked: value ? 'checked' : 'unchecked'
},
accessibilityValue: {
text: value ? '1' : '0'
}
};
} Starting RN73 (or 72), the native accessibility value is now determined based on both
|
WorkaroundResort to jest-expecting based on const attributes = await element(...).getAttributes();
jestExpect(attributes.value).toEqual('switch, 0'); Solution
|
I see RN continues to break platform norms like crazy. 🤦♂️ The accessibility value is used for things like VoiceOver. So I guess now RN has broken VoiceOver support because … reasons. |
Leo! How have you been? 😄 |
Hello 🙂 |
React's own |
What happened?
A common matcher such as:
seems to have stopped working when upgrading from RN 71 to 73. It introduces the following error:
What was the expected behaviour?
No response
Was it tested on latest Detox?
Did your test throw out a timeout?
Help us reproduce this issue!
Should repro on any screen with a toggle coming from
react-native-ui-lib
.In what environment did this happen?
Detox version:
React Native version:
Has Fabric (React Native's new rendering system) enabled: (yes/no)
Node version:
Device model:
iOS version:
macOS version:
Xcode version:
Test-runner (select one): jest / other
Detox logs
Detox logs
Device logs
Device logs
More data, please!
No response
The text was updated successfully, but these errors were encountered: