-
Notifications
You must be signed in to change notification settings - Fork 276
Deprecate react-unit-test-utils 1/2 #1750
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is there ever a scenario where we wouldn't find the title but could still find the
unit-iframe-wrapper
? Just want to confirm that switching from checking for thecontentIFrame
test id to this still verifies the same thing.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.
In the codebase when this component is used, it appends the unit title, only if you don't add a title to a unit that will be applicable 🤔 i can add that use case if needed
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.
I just know that the previous version of this was testing for
testIDs.contentIFrame
, and now it's testing forprops.title
. If there's a scenario where we would have the test id but not the title then that means we've changed what this test is looking for.Uh oh!
There was an error while loading. Please reload this page.
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.
yeah i made that change in order to follow Braden's suggestion of
I thought get it by title will be the accessible query that fits this use case, but we can bring it back if you think we are missing an edge case here 🤔
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.
As a reviewer this is something where having added context would be helpful. Something like:
Previously this was testing for
testIDs.contentIFrame
, which was coming fromfrontend-app-learning/src/courseware/course/sequence/Unit/ContentIFrame.jsx
Line 26 in a75c89c
In the component, the test id is used here
frontend-app-learning/src/courseware/course/sequence/Unit/ContentIFrame.jsx
Lines 73 to 77 in a75c89c
this also renders the title, which is preferable to test for to follow RTL best practices.
Since
title
is a required prop for theContentIFrame
componentfrontend-app-learning/src/courseware/course/sequence/Unit/ContentIFrame.jsx
Line 113 in a75c89c
this should still cover all cases that the previous test id based test covered.
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.
Sure i will have this in mind on following PRs! Thanks Brian 😄