From 7667e16eed430db58c4021123c4c51980d788757 Mon Sep 17 00:00:00 2001 From: Bruno Castro Date: Wed, 29 Jul 2020 15:23:05 -0300 Subject: [PATCH] feat: support RN 0.62 accessibilityState in toBeDisabled (#30) --- README.md | 15 ++-- src/__tests__/to-be-disabled.js | 154 ++++++++++++++------------------ src/to-be-disabled.js | 14 ++- 3 files changed, 88 insertions(+), 95 deletions(-) diff --git a/README.md b/README.md index bcb1393..7f93c4f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

jest-native

- + - +

Custom jest matchers to test the state of React Native.

@@ -117,15 +117,18 @@ toBeDisabled(); Check whether or not an element is disabled from a user perspective. This matcher will check if the element or its parent has a `disabled` prop, or if it has -`accessibilityStates={['disabled']}`. +`accessibilityState={{disabled: true]}. + +It also works with `accessibilityStates={['disabled']}` for now. However, this prop is deprecated in +React Native [0.62](https://reactnative.dev/blog/2020/03/26/version-0.62#breaking-changes) #### Examples ```javascript const { getByTestId } = render( -