From 264901745485ff0ae05e34fcc1a9f1fa6f1959b3 Mon Sep 17 00:00:00 2001 From: mateusbw <39418995+mateusbw@users.noreply.github.com> Date: Mon, 7 Sep 2020 11:26:10 -0300 Subject: [PATCH] feat: support RN 0.63 pressable in toBeDisabled (#33) Co-authored-by: Bruno Castro --- package.json | 4 ++-- src/__tests__/to-be-disabled.js | 2 ++ src/to-be-disabled.js | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 41182fa..98383f4 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@babel/cli": "7.2.3", "@babel/core": "7.4.0", "@babel/runtime": "7.4.0", - "@testing-library/react-native": "^4.0.1", + "@testing-library/react-native": "^6.0.0", "commitizen": "^3.0.7", "cz-conventional-changelog": "^2.1.0", "husky": "^1.3.1", @@ -48,7 +48,7 @@ "prettier": "^1.16.4", "pretty-quick": "^1.10.0", "react": "16.8.6", - "react-native": "^0.59.6", + "react-native": "0.63.2", "react-test-renderer": "16.8.6", "semantic-release": "^15.13.3" }, diff --git a/src/__tests__/to-be-disabled.js b/src/__tests__/to-be-disabled.js index f64e2cf..b449c6a 100644 --- a/src/__tests__/to-be-disabled.js +++ b/src/__tests__/to-be-disabled.js @@ -6,6 +6,7 @@ import { TouchableWithoutFeedback, View, TextInput, + Pressable, } from 'react-native'; import { render } from '@testing-library/react-native'; @@ -16,6 +17,7 @@ const ALLOWED_COMPONENTS = { TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback, + Pressable, }; describe('.toBeDisabled', () => { diff --git a/src/to-be-disabled.js b/src/to-be-disabled.js index 2b7b2b0..3ac9fa9 100644 --- a/src/to-be-disabled.js +++ b/src/to-be-disabled.js @@ -14,6 +14,7 @@ const DISABLE_TYPES = [ 'TouchableWithoutFeedback', 'View', 'TextInput', + 'Pressable', ]; function isElementDisabledByParent(parent) {