-
Notifications
You must be signed in to change notification settings - Fork 272
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
fix: find by timeout with detached screen #1576
Conversation
@@ -14,6 +14,6 @@ test('findByTestId detects screen being detached', async () => { | |||
await expect(promise).rejects.toThrowErrorMatchingInlineSnapshot(` | |||
"Unable to find an element with testID: not-exists | |||
|
|||
Screen is no longer attached." | |||
Screen is no longer attached. Check your test for "findBy*" or "waitFor" calls that have not been awaited." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! I wonder if it could be the right place to advice using the eslint plugin as well, maybe as a second paragraph? wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out the updated text
ecb0005
to
4c20bfb
Compare
….5 (#5196) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@testing-library/react-native](https://callstack.github.io/react-native-testing-library) ([source](https://togithub.com/callstack/react-native-testing-library)) | [`^12.4.3` -> `^12.4.5`](https://renovatebot.com/diffs/npm/@testing-library%2freact-native/12.4.3/12.4.5) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>callstack/react-native-testing-library (@​testing-library/react-native)</summary> ### [`v12.4.5`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.5) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.4...v12.4.5) #### RNTL 12.4.5 (2024-03-28) ##### Bugfixes - `findBy*` timeout with detached screen by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [https://github.com/callstack/react-native-testing-library/pull/1576](https://togithub.com/callstack/react-native-testing-library/pull/1576) ##### Other - docs: update docs about eslint rule by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [https://github.com/callstack/react-native-testing-library/pull/1578](https://togithub.com/callstack/react-native-testing-library/pull/1578) **Full Changelog**: callstack/react-native-testing-library@v12.4.4...v12.4.5 ### [`v12.4.4`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.4) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.3...v12.4.4) #### RNTL 12.4.4 (2024-03-18) ##### Bug Fixes - **user-event**: Decouple press events from Jest dependency by [@​JoseLion](https://togithub.com/JoseLion) in [https://github.com/callstack/react-native-testing-library/pull/1571](https://togithub.com/callstack/react-native-testing-library/pull/1571) #### New Contributors - [@​retyui](https://togithub.com/retyui) made their first contribution in [https://github.com/callstack/react-native-testing-library/pull/1567](https://togithub.com/callstack/react-native-testing-library/pull/1567) - [@​donysukardi](https://togithub.com/donysukardi) made their first contribution in [https://github.com/callstack/react-native-testing-library/pull/1569](https://togithub.com/callstack/react-native-testing-library/pull/1569) - [@​JoseLion](https://togithub.com/JoseLion) made their first contribution in [https://github.com/callstack/react-native-testing-library/pull/1571](https://togithub.com/callstack/react-native-testing-library/pull/1571) **Full Changelog**: callstack/react-native-testing-library@v12.4.3...v12.4.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
….5 (#5196) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@testing-library/react-native](https://callstack.github.io/react-native-testing-library) ([source](https://togithub.com/callstack/react-native-testing-library)) | [`^12.4.3` -> `^12.4.5`](https://renovatebot.com/diffs/npm/@testing-library%2freact-native/12.4.3/12.4.5) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>callstack/react-native-testing-library (@​testing-library/react-native)</summary> ### [`v12.4.5`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.5) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.4...v12.4.5) #### RNTL 12.4.5 (2024-03-28) ##### Bugfixes - `findBy*` timeout with detached screen by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [https://github.com/callstack/react-native-testing-library/pull/1576](https://togithub.com/callstack/react-native-testing-library/pull/1576) ##### Other - docs: update docs about eslint rule by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [https://github.com/callstack/react-native-testing-library/pull/1578](https://togithub.com/callstack/react-native-testing-library/pull/1578) **Full Changelog**: callstack/react-native-testing-library@v12.4.4...v12.4.5 ### [`v12.4.4`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.4) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.3...v12.4.4) #### RNTL 12.4.4 (2024-03-18) ##### Bug Fixes - **user-event**: Decouple press events from Jest dependency by [@​JoseLion](https://togithub.com/JoseLion) in [https://github.com/callstack/react-native-testing-library/pull/1571](https://togithub.com/callstack/react-native-testing-library/pull/1571) #### New Contributors - [@​retyui](https://togithub.com/retyui) made their first contribution in [https://github.com/callstack/react-native-testing-library/pull/1567](https://togithub.com/callstack/react-native-testing-library/pull/1567) - [@​donysukardi](https://togithub.com/donysukardi) made their first contribution in [https://github.com/callstack/react-native-testing-library/pull/1569](https://togithub.com/callstack/react-native-testing-library/pull/1569) - [@​JoseLion](https://togithub.com/JoseLion) made their first contribution in [https://github.com/callstack/react-native-testing-library/pull/1571](https://togithub.com/callstack/react-native-testing-library/pull/1571) **Full Changelog**: callstack/react-native-testing-library@v12.4.3...v12.4.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
….5 (valora-inc#5196) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@testing-library/react-native](https://callstack.github.io/react-native-testing-library) ([source](https://togithub.com/callstack/react-native-testing-library)) | [`^12.4.3` -> `^12.4.5`](https://renovatebot.com/diffs/npm/@testing-library%2freact-native/12.4.3/12.4.5) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>callstack/react-native-testing-library (@​testing-library/react-native)</summary> ### [`v12.4.5`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.5) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.4...v12.4.5) #### RNTL 12.4.5 (2024-03-28) ##### Bugfixes - `findBy*` timeout with detached screen by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [https://github.com/callstack/react-native-testing-library/pull/1576](https://togithub.com/callstack/react-native-testing-library/pull/1576) ##### Other - docs: update docs about eslint rule by [@​mdjastrzebski](https://togithub.com/mdjastrzebski) in [https://github.com/callstack/react-native-testing-library/pull/1578](https://togithub.com/callstack/react-native-testing-library/pull/1578) **Full Changelog**: callstack/react-native-testing-library@v12.4.4...v12.4.5 ### [`v12.4.4`](https://togithub.com/callstack/react-native-testing-library/releases/tag/v12.4.4) [Compare Source](https://togithub.com/callstack/react-native-testing-library/compare/v12.4.3...v12.4.4) #### RNTL 12.4.4 (2024-03-18) ##### Bug Fixes - **user-event**: Decouple press events from Jest dependency by [@​JoseLion](https://togithub.com/JoseLion) in [https://github.com/callstack/react-native-testing-library/pull/1571](https://togithub.com/callstack/react-native-testing-library/pull/1571) #### New Contributors - [@​retyui](https://togithub.com/retyui) made their first contribution in [https://github.com/callstack/react-native-testing-library/pull/1567](https://togithub.com/callstack/react-native-testing-library/pull/1567) - [@​donysukardi](https://togithub.com/donysukardi) made their first contribution in [https://github.com/callstack/react-native-testing-library/pull/1569](https://togithub.com/callstack/react-native-testing-library/pull/1569) - [@​JoseLion](https://togithub.com/JoseLion) made their first contribution in [https://github.com/callstack/react-native-testing-library/pull/1571](https://togithub.com/callstack/react-native-testing-library/pull/1571) **Full Changelog**: callstack/react-native-testing-library@v12.4.3...v12.4.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Summary
Fixes error on access to detached
screen
object infindBy
calls.Resolves #1572
Test plan