Repository navigation
Intro to React Testing: Provide background context for UI testing - #30146
Conversation
Lesson currently missing background context - just dives straight into how to write the tests.
Helpful context as to what's actually being rendered during our tests and how
|
@hbar1st would love to hear your thoughts on this if you have the time, since you were the issue author. |
hbar1st
left a comment
There was a problem hiding this comment.
hi Mao, Thank you for taking the time to improve this topic.
For the paragraph about rendering, I'd like to see a little more background.
For example:
When I google what render does, I get:
The render function simulates rendering a component as it would in a browser.
I think this is important to know.
I also think we should mention what querying is here. Its the same querying we learned about in DOM querying? I think it is worth restating what that is and why we need it.
Maybe something that explains the absolute basic steps of testing a UI which seem to be:
- setup your component in some way
- render your component
- possibly fire an event if needed
- query some element that you need to check after the render is done
- test it against your expectations
Sorry, its rough but I only say this because I feel we almost need to map this out in addition to describing what the words mean.
|
Thanks for your thoughts @hbar1st Everyone will understand things in different ways and may well need to look stuff up further, and that's okay and very much encouraged. Personally, I believe what's been added, in the context of the entire lesson (main contents, links, and assignments), is sufficient to cover the things you mentioned. If someone feels they need a deeper explanation of what the Same with querying (which is a generic term that means the same thing wherever it's used, whether querying the actual DOM, the jsdom in the test, querying a DB etc.). I feel the lesson as a whole is sufficient in that regard, which takes into account the lesson contents and any links/assignments. Again, if people feel they want a deeper dive into querying specifics, they are always encouraged to research independently. |
Because
This is the first lesson on UI testing which is a bit different to prior testing content.
People often struggle to grasp the value of UI testing due to narrower experience with simpler projects where they can manually test the UI, and don't always make the connection between the value of this and non-UI testing.
Instead of diving straight into setup and syntax, it would benefit to provide a little background context for UI testing and its value.
While we're at it, a small mention of
jsdomwill also provide context for how the tests actually work/what they're doing (otherwise it's a bit of a black box when the setup guide tells people to install it but they don't know why). No need to dive deep - any further can be independently explored.This PR
jsdomIssue
Closes #29377
Additional Information
Pull Request Requirements
location of change: brief description of changeformat, e.g.Intro to HTML and CSS lesson: Fix link textBecausesection summarizes the reason for this PRThis PRsection has a bullet point list describing the changes in this PRIssuesection