From b5e649fcf6066f5a7f26036e1079a11c77e6117c Mon Sep 17 00:00:00 2001 From: Huzaifa Date: Fri, 2 Apr 2021 11:42:46 -0700 Subject: [PATCH] Accessibility/button test (#31189) Summary: This PR aims to add test's for button. Snapshot test for PR https://github.com/facebook/react-native/issues/31001 . This would make sure `accessibilityState` is properly set. ## Changelog [General] [Added] - Test's for button Pull Request resolved: https://github.com/facebook/react-native/pull/31189 Test Plan: `npm test` to run the test's. Since the disabled prop of button has precedence over `accessibilityState.disabled` the test's will make sure it remains this way. Reviewed By: kacieb Differential Revision: D27473082 Pulled By: lunaleaps fbshipit-source-id: 65d82620e8c245c2a8e29c3e9a8252d3a4275b09 --- Libraries/Components/__tests__/Button-test.js | 49 +++ .../__snapshots__/Button-test.js.snap | 368 ++++++++++++++++++ 2 files changed, 417 insertions(+) create mode 100644 Libraries/Components/__tests__/Button-test.js create mode 100644 Libraries/Components/__tests__/__snapshots__/Button-test.js.snap diff --git a/Libraries/Components/__tests__/Button-test.js b/Libraries/Components/__tests__/Button-test.js new file mode 100644 index 0000000000..f81f9bc63d --- /dev/null +++ b/Libraries/Components/__tests__/Button-test.js @@ -0,0 +1,49 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import * as React from 'react'; +import ReactTestRenderer from 'react-test-renderer'; +import Button from '../Button'; + +describe('