Skip to content

.toBeDisabled() buggy with RN 0.62 #23

Closed as not planned
Closed as not planned
@mtt87

Description

@mtt87
  • react-native or expo: 0.62.1
  • @testing-library/react-native version: 3.1.0
  • react-native version: 0.62.1
  • node version: 12.16.1

Latest version of RN deprecated accessibilityStates in favor of accessibilityState
https://reactnative.dev/blog/2020/03/26/version-0.62#breaking-changes

Seems like now it's an object
facebook/react-native@7b35f42

I suspect we need to change it here

path(['props', 'accessibilityStates']),

It's quite weird that in my codebase everything works fine except 1 use case where I have something like this

<TouchableOpacity disabled testID="button">
  <Button disabled>

And when I check it fails, no matter if the received output from jest seems to be correct and it has the disabled prop and it's true

{
  "disabled": true,
  "testID": "button",
  "children": <Button>
}

Can you help us fix this issue by submitting a pull request?

I checked the codebase and there is an intense use of ramda which hurts my eyes and find it quite difficult to work with, but I'll try to make a PR 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions