-
Notifications
You must be signed in to change notification settings - Fork 450
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
test(sanity): update hydrate test #6821
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
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 slept on it and I think the reason I used the snapshots when I wrote these tests originally was to aid debugging: "what does it render?"
Since they keep failing the tests when class strings change I think they do more harm than good so it makes sense to get rid of them.
The hydrateRoot test is very useful though as it would catch issues that would otherwise only appear for Studios that are embedded in Next or Remix apps 🙌
Component Testing Report Updated May 31, 2024 7:01 AM (UTC)
|
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.
Description
Updated the studio.test.tsx after having it consistently failing on a separate PR and updating the snapshot not fixing it (the classes were consistently changing)
Spoke with Cody and in that case in particular it was related to the style components and the order with which the components that use them are called.
The snapshot test was brittle since it was screaming that something was wrong when it reality it could just be different (and that was the intended result). The following test was written with Cody to remain useful and to target hydration test but without having to rely on snapshots.
What to review
That the test makes sense and there isn't a better way of doing it.
Notes for release
N/A (let me know if this is something that we want to appear on the release notes I just don't think we need to)