Skip to content

feat: add findBy* queries #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 15, 2020

Conversation

mdjastrzebski
Copy link
Member

Summary

Added findBy queries for original queries (ByText, ByPlaceholder, ByDisplayValue, ByTestId) as well as for a11y queries.

Note: in case of findByTestId I used custom finding algorithm because current implementation of getByTestId is broken.

Test plan

Added units tests for all of the new queries.

@mdjastrzebski mdjastrzebski marked this pull request as draft May 13, 2020 12:56
@mdjastrzebski mdjastrzebski linked an issue May 13, 2020 that may be closed by this pull request
@thymikee thymikee requested a review from cross19xx May 13, 2020 13:17
Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing updates to typings/index.d.ts for TS users, but from a quick look it looks good!

@mdjastrzebski mdjastrzebski marked this pull request as ready for review May 13, 2020 14:05
* prettier did reformat some code arround
@mdjastrzebski
Copy link
Member Author

Missing updates to typings/index.d.ts for TS users, but from a quick look it looks good!

I've added typescipt type definitions & tests for that.

@mdjastrzebski
Copy link
Member Author

Reversed prettier run on typings files in order to remove noise from the PR :-)

@thymikee thymikee changed the title Feature/find by queries feat: add findBy* queries May 14, 2020
@mdjastrzebski
Copy link
Member Author

I've added overlapping parts with within operator which has been merged to master.

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@thymikee thymikee merged commit ab34712 into callstack:master May 15, 2020
mdjastrzebski added a commit to mdjastrzebski/react-native-testing-library that referenced this pull request May 15, 2020
* 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>
thymikee added a commit that referenced this pull request May 18, 2020
* Added @testing-library/jest-native to devDependencies

* Tests for jest-native matchers

* Added @testing-library/jest-native install info

* Update README.md

* Update GettingStarted.md

* feat: add `findBy*` queries (#304)

* 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>

* chore: bump eslint config to latest (#308)

* chore: bump eslint config to latest

* lint fix

* lint pass

* use roles directly

* Trying to fix CI build

* Added $FlowFixMe for missing flow expect extensions

* Small doc fixes

* Clarified failing toHaveProps matcher tests

* Moved lint ignore for color literals to .eslintrc

* Updated toHaveProp tests to avoid strange `Button` behavior

* Updated yarn.lock

* Update README.md

* Update website/docs/GettingStarted.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
@mdjastrzebski mdjastrzebski deleted the feature/findByQueries branch May 19, 2020 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add FindBy* queries
3 participants