Skip to content

docs: add migration to v7 guide #456

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 8 commits into from
Jul 27, 2020
Merged

docs: add migration to v7 guide #456

merged 8 commits into from
Jul 27, 2020

Conversation

thymikee
Copy link
Member

Summary

Closes #442

Test plan

image

@thymikee
Copy link
Member Author

thymikee commented Jul 24, 2020

We can merge this guide before the actual migration, because it won't show up in the guides just yet. It will be hidden under "/react-native-testing-library/docs/migration-v7" link for now.

EDIT: nevermind, I've created 7.x branch so we can merge anytime anyway.

@thymikee thymikee changed the base branch from master to 7.x July 24, 2020 20:52
Copy link

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Solid 💯 I'm thrilled how simple this will be to migrate. Thank you for all your work @thymikee!

@thymikee thymikee force-pushed the feat/migration-guide-7 branch from bbb8b18 to 116ef86 Compare July 24, 2020 20:55
@thymikee thymikee force-pushed the feat/migration-guide-7 branch from 116ef86 to 3e9bfbc Compare July 24, 2020 20:57
@thymikee thymikee force-pushed the feat/migration-guide-7 branch from 3d59e3f to 7b564de Compare July 24, 2020 22:37
Copy link
Member

@mdjastrzebski mdjastrzebski left a comment

Choose a reason for hiding this comment

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

Overally LGTM. Some questions and suggestions.


## No special handling for `disabled` prop

The `disabled` prop on "Touchable\*" components is treated in the same manner as any other prop. We realize that with our library you can press "touchable" components even though they're in "disabled" state, however this is something that we strongly believe should be fixed upstream, in React Native core.
Copy link
Member

Choose a reason for hiding this comment

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

From what I can read in RNTL code it seems that the logic is to find prop with given name (e.g. onPress for press event) and just run it. I'm not sure how this should be fixed by RN, so that we could use it in RNTL, as we are executing the prop function without delegating event logic to RN. One option for RN would be to automatically wrap onPress assignment which would add if(!disabled) check, but this will actually assign a different function there.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could try adding onStartShouldSetResponder check support, which should solve this particular problem. Likely not thorough enough to improve whole event firing system, but maybe it's a good start.

Copy link
Member Author

Choose a reason for hiding this comment

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

Went ahead and merged the guide, we can still amend it when we decide to act on this topic

thymikee and others added 4 commits July 27, 2020 10:03
Co-authored-by: Maciej Jastrzebski <[email protected]>
Co-authored-by: Maciej Jastrzebski <[email protected]>
Co-authored-by: Maciej Jastrzebski <[email protected]>
Co-authored-by: Maciej Jastrzebski <[email protected]>
@thymikee thymikee merged commit 07a4606 into 7.x Jul 27, 2020
@thymikee thymikee deleted the feat/migration-guide-7 branch July 27, 2020 20:50
thymikee added a commit that referenced this pull request Jul 30, 2020
* docs: add migration to v7 guide

* adjust note about ByTitle because there's no host Button component

* add fire event section

* mention NativeTestInstance and container

* Update website/docs/MigrationV7.md

Co-authored-by: Maciej Jastrzebski <[email protected]>

* Update website/docs/MigrationV7.md

Co-authored-by: Maciej Jastrzebski <[email protected]>

* Update website/docs/MigrationV7.md

Co-authored-by: Maciej Jastrzebski <[email protected]>

* Update website/docs/MigrationV7.md

Co-authored-by: Maciej Jastrzebski <[email protected]>

Co-authored-by: Maciej Jastrzebski <[email protected]>
thymikee added a commit that referenced this pull request Jul 30, 2020
* docs: add migration to v7 guide

* adjust note about ByTitle because there's no host Button component

* add fire event section

* mention NativeTestInstance and container

* Update website/docs/MigrationV7.md

Co-authored-by: Maciej Jastrzebski <[email protected]>

* Update website/docs/MigrationV7.md

Co-authored-by: Maciej Jastrzebski <[email protected]>

* Update website/docs/MigrationV7.md

Co-authored-by: Maciej Jastrzebski <[email protected]>

* Update website/docs/MigrationV7.md

Co-authored-by: Maciej Jastrzebski <[email protected]>

Co-authored-by: Maciej Jastrzebski <[email protected]>
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.

Move to @testing-library/react-native 🎉
3 participants