Describe the bug
When using *ByA11yState queries they perform match given element only when given option has the exact values as passed.
Current behavior
getByA11yState({ disabled: true }) will match <View accessibilityState={{ disabled: true }} /> (OK)
getByA11yState({ disabled: false }) will match <View accessibilityState={{ disabled: false }} /> (OK)
getByA11yState({ disabled: false }) will NOT match <View accessibilityState={{}} /> (NOT OK)
Expected behavior
getByA11yState({ disabled: false }) should match <View />
- similarly for other state options we should assume the each of them has a default value of
false if not specified otherwise.
Versions
11.2.0 and below
Related issues
#1161 - issue where we discovered the bug
CC: @thymikee @AugustinLF @pierrezimmermannbam
Describe the bug
When using
*ByA11yStatequeries they perform match given element only when given option has the exact values as passed.Current behavior
getByA11yState({ disabled: true })will match<View accessibilityState={{ disabled: true }} />(OK)getByA11yState({ disabled: false })will match<View accessibilityState={{ disabled: false }} />(OK)getByA11yState({ disabled: false })will NOT match<View accessibilityState={{}} />(NOT OK)Expected behavior
getByA11yState({ disabled: false })should match<View />falseif not specified otherwise.Versions
11.2.0 and below
Related issues
#1161 - issue where we discovered the bug
CC: @thymikee @AugustinLF @pierrezimmermannbam