-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Update tests so we can migrate SlotFill component to the stable context API #11314
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
|
As per @gziolo suggestion here I've tried not to use snapshot testing, but having the HTML inside the test. It looks like it's more difficult than it's supposed to and I couldn't figure out. I can give it a second try if that's a blocker. I'm actually inclined to think that snapshot testing is a fine choice here. |
|
@aduth @nerrad as you have some experience with writing test using expect( element.html() ).toBe( '<div><span></span></div>' );If not let's use snapshots instead. My only concern is that having 10 snapshots for so simple HTML snippets makes those tests much harder to read. However, it doesn't seem to be a blocker here. |
|
If you're just testing a simple structure like that (i.e. no expected css class or props) I would think snapshots are fine. Provided the test has good enough description the snapshots aren't too hard to follow. As soon as you get to testing unit written components though you have to keep in mind that |
6ac3037 to
4e5b61c
Compare
|
Rebased from master. |
Why can just do :) |
youknowriad
left a comment
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.
Tests pass, that's good enough for me 👍
I don't want to block the other PR
|
Cool, going to merge both PRs. We can always iterate on how tests are written. |
This PR prepares our test suite to be testable against the stable Context API, so we can migrate our code safely. Once this lands, we can merge #11123