Skip to content

fix(breaking): getByTestId should work only for native elements #324

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

Conversation

mdjastrzebski
Copy link
Member

Summary

Existing version of getByTestId had a bug (#270) as it returned also non-native elements. This was in contract with getAllByTestId which returned only native elements.

Test plan

Added tests checking getByTestId behavior.

@mdjastrzebski mdjastrzebski changed the base branch from master to next May 18, 2020 09:16
@mdjastrzebski
Copy link
Member Author

Fixes #270

@mdjastrzebski mdjastrzebski changed the title Fix/get by test id should work only for native elements fix: getByTestId should work only for native elements May 18, 2020
@thymikee thymikee changed the title fix: getByTestId should work only for native elements fix(breaking): getByTestId should work only for native elements May 18, 2020
@thymikee thymikee merged this pull request into callstack:next May 18, 2020
thymikee pushed a commit that referenced this pull request May 18, 2020
* Replaced getByTestId with fixed version

* Added tests

* Fixed flow-check

* Updated docs

* Fixed lint error

* Used getByTestId in unit tests instead of queryByTestId

* Updated negative checks in tests
thymikee pushed a commit that referenced this pull request May 28, 2020
* Replaced getByTestId with fixed version

* Added tests

* Fixed flow-check

* Updated docs

* Fixed lint error

* Used getByTestId in unit tests instead of queryByTestId

* Updated negative checks in tests
@conor909
Copy link

Is there some documentation that needs to be updated regarding this? My getByTestId code works for native but not for web

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.

getAllByTestId returns empty list while getByTestId returns an item
3 participants