* Basic async findBy queries
* Refactored findBy queries to be built with makeFindQuery
* findBy queries for A11y selectors
* Custom findByTestId implementation that avoids current getByTestId issues
* Fixed prettier issue
* Updates Queries.md with findBy queries
* Trying to fix test timeout error appearing only on CI
* Code review changes
* Added typescript types & tests
* prettier did reformat some code arround
* Removed export of GetByAPI, QueryByAPI and FindByAPI interfaces in TS
* Reversed prettier run on typings
* Added overlapping pieces with `within` operator
* Small cleanup
* Update website/docs/Queries.md
* Moved async/await tests to the end of test methods
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
* feat: add getAllByTestId and queryAllByTestId queries
* Add test for getAllByTestId and queryAllByTestId
- Filter out intermediate components in getAllByTestId. testIDs may be passed down to child components and appearing multiple times in the render tree. Some React Native components render multiple anyways. <Text> is an example.
* Update TypeScript typings
* Fix flow types
* Update TS typings test
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->
### Summary
Users of `react-testing-library` use `rerender` wording instead of `update`. Let's make it easier for them by aliasing it.
See: https://testing-library.com/docs/react-testing-library/api#rerender
### Test plan
Added cases for JS tests and TS typings
### Summary
There is a helper that exists in `react-testing-library` to query inputs by their `placeholder`. This PR adds that support.
You **could** achieve this by querying for a `placeholder` prop, or querying for react native `TextInput`s manually and then checking their props, but it felt cleaner to have this contained in the testing library itself. It will also allow you to bypass any other instances that may have a `placeholder` prop that aren't `TextInput`s.
If we don't want to expand the surface of the library further, I completely understand that and am fine with this being closed. Just seems like it may be useful and save some time for several scenarios =)
### Test plan
+ Render a `TextInput` with a `placeholder` prop
+ Query the test instance via `getByPlaceholder` for the input
+ Verify the test instance is found
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->
### Summary
Make `debug.deep` more usable by allowing it to print arbitrary JSON (and actually any) files. This proves handy when we want to debug async component which we want to snapshot after async operations:
```jsx
const { toJSON, getByName } = render(
<Button onPress={jest.fn} text="Press me" />
);
fireEvent.press(getByName('TouchableOpacity'));
await flushMicrotasksQueue();
debug.deep(toJSON());
```
### Test plan
added one
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->
### Summary
This actually uncovered some bugs, like lack of `onDoublePress` (lol XD) and enabled us to have better snapshots for deep rendering.
### Test plan
no new tests