diff --git a/docs/Queries.md b/docs/Queries.md index 3264bdd33..e82d786db 100644 --- a/docs/Queries.md +++ b/docs/Queries.md @@ -148,6 +148,34 @@ const { getByA11yRole } = render(); const element = getByA11yRole('button'); ``` +### `ByA11yState`, `ByAccessibilityState` + +> getByA11yState, getAllByA11yState, queryByA11yState, queryAllByA11yState +> getByAccessibilityState, getAllByAccessibilityState, queryByAccessibilityState, queryAllByAccessibilityState + +Returns a `ReactTestInstance` with matching `accessibilityState` prop. + +```jsx +import { render } from 'react-native-testing-library'; + +const { getByA11yState } = render(); +const element = getByA11yState({ disabled: true }); +``` + +### `ByA11Value`, `ByAccessibilityValue` + +> getByA11yValue, getAllByA11yValue, queryByA11yValue, queryAllByA11yValue +> getByAccessibilityValue, getAllByAccessibilityValue, queryByAccessibilityValue, queryAllByAccessibilityValue + +Returns a `ReactTestInstance` with matching `accessibilityValue` prop. + +```jsx +import { render } from 'react-native-testing-library'; + +const { getByA11yValue } = render(); +const element = getByA11yValue({ min: 40 }); +``` + ## Unit testing helpers > Use sparingly and responsibly, escape hatches here @@ -159,20 +187,23 @@ const element = getByA11yRole('button'); The interface is the same as for other queries, but we won't provide full names so that they're harder to find by search engines. -### `ByType` +### `UNSAFE_ByType`, `ByType` > Note: added in v1.4 +> This method has been **deprecated** and has been prepended with `UNSAFE_` prefix. In react-native-testing-library 2.x only the prefixed version will work. + A method returning a `ReactTestInstance` with matching a React component type. Throws when no matches. -### `ByProps` +### `UNSAFE_ByProps`, `ByProps` + +> This method has been **deprecated** and has been prepended with `UNSAFE_` prefix. In react-native-testing-library 2.x only the prefixed version will work. A method returning a `ReactTestInstance` with matching props object ### `ByName` > This method has been **deprecated** because using it results in fragile tests that may break between minor React Native versions. **DON'T USE IT**. It will be removed in next major release (v2.0). Use [`getByTestId`](#bytestid) instead. It's listed here only for back-compat purposes for early adopters of the library - A method returning a `ReactTestInstance` with matching a React component type. Throws when no matches.