* BREAKING CHANGE : make placeholdertext queries return host elements
* BREAKING CHANGE : make displayValue queries return host elements
* BREAKING CHANGE: make text queries return host elements
* refactor: reset config to default before each test
* feat: use component names from config and add api to configure them
* feat: remove legacy option from queries
* refactor: reorganize legacy and breaking tests for queries
* feat: change error messages for mismatching host component names
* fix: do not update screen when running auto detection
* fix: typo in comment
* refactor: use an object for matchTextContent params
* tests: rewrite some tests to match repo patterns
* fix: use legacy queries by default to prevent breaking changes
* fix: remove wrong uppercase in flow typings
* docs: remove section on useLegacy queries as it wont be a public api
* docs: small improvements based on review
* fix: remove typo in error message
* refactor: rename getReactNativeHostComponentNames to detectHostComponentNames
* refactor: use useBreakingChange from internal config instead of useLegacyQueries
* fix: use fake timers in test so it doesnt take too much time
* refactor: replace type assertions by real type checking
* fix: revert change due to rebase
* fix: improvements after review
* refactor: define type to match inside matchTextContent function
* refactor: rename function to get error message
* feat: display error when auto detect of host component names throw
* fix: remove unused ts-expect-error after ts version bump
* refactor: run auto detection on render if it hasnt been run yet
* refactor: reuse type imports that had been converted to regular ones
* refactor: add comments to distinguish breaking and legacy
* refactor: move config logic into detectComponentHostNames function
* refactor: rename function to detectComponentHostNamesIfNeeded
* tests: add test on detectHostComponentNamesIfNeeded
* fix: use host component name from config for textinput in fireEvent
* refactor: run autodetection in text, displayvalue and placeholder queries rather than in render
* refactor: remove useless async declaration
* refactor: improvements for readability from review
* Update src/__tests__/host-component-names.test.tsx
* refactor: declare variable for host component names in detection function
* refactor: rename detectHostComponentNamesIfNeeded to getHostComponentNames
* feat: use getHostComponentNames in fireEvent for textinput host name
* refactor: revert refactor on matchTextContent
* refactor: add comment to indicate impossible path
* chore: simplify jest-setup files
* refactor: code review changes
Co-authored-by: pierrezimmermann <pierrez@nam.tech>
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
* feature: screen
* feature: update docs
* refactor: add flow type
* docs: more
* docs: final tweaks
* test rerender
* code review changes
* alias RenderResult to RenderAPI
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
* Add TextMatch options to getByAPI
* Add TextMatch options to queryByAPI
* Add TextMatch options to findByAPI
* Add tests covering new TextMatch options
* Add documentation and examples for TextMatch options
* Implement text match normalization customization
* Implement tests for normalization options
* Add text normalization docs
* Refactor typings
* Add export for getDefaultNormalizer function
* Remove undocumented config for normalizer function
* Update website/docs/Queries.md
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
* BREAKING: make findBy* queries arguments order compatible with RTL
* Fix tests for findBy queries after changing their API
* Fix matching nested Text components with queryOptions exact set to true
* Remove recursion matching for *byText APIs
* Reuse getAllByText in getByText
* Add Textmatch options to *byTestId
* fix: types for getDefaultNormalizer
* refactor: remove makeNormalizer and use getDefaultNormalizer() instead
* refactor: change params position and description for matches
* refactor: move & remove duplicated tests after merge
* Make waitForOptions param change non breaking change
* chore: cleanup and type fixups
* tests: update snapshots
* chore: use default arg value for normalizer
* Restore mock after use
* fix: wrong snapshot update with outdated deps
Co-authored-by: Rafał Zakrzewski <zakrzewski.rafal@gmail.com>
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
Co-authored-by: Damian Sznajder <damsznajder@gmail.com>
* any return time for Debug (implicit any errors)
* Update typings/index.d.ts
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
* feat: Add alias accessibilityLabel queries to assist in migrating from @testing-library/react-native
* feat: Add alias accessibilityHint queries to assist in migrating from @testing-library/react-native
* feat: Add alias accessibilityRole queries to assist in migrating from @testing-library/react-native
* feat: Add to A11yAPI types to include the newly-aliased queries for label, hint, and role
* test: Add tests for newly-aliased label, hint, and role a11y queries
* test: Add newly-alised a11y queries to the index typings test file
* docs: Add query aliases for testing library migrators to Queries documentation
* test: Consolidate aliased query tests into shared tests. FIXME's where there are errors
* test: Update a11yAPI tests to assert referential equality for query aliases
* refactor: apply Prettier formatting to a11yAPI test file
* fix: address typos in CONTRIBUTING.md
* test: Separate referential quality assertion tests for query aliases into their own tests
Co-authored-by: Ryan Wessel <rwessel@dataminr.com>
* 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