Skip to content
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

Merged
merged 1 commit into from
May 31, 2024
Merged

test(sanity): update hydrate test #6821

merged 1 commit into from
May 31, 2024

Conversation

RitaDias
Copy link
Contributor

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)

@RitaDias RitaDias requested a review from a team as a code owner May 31, 2024 06:52
@RitaDias RitaDias requested review from binoy14 and removed request for a team May 31, 2024 06:52
Copy link

vercel bot commented May 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 6:54am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 6:54am
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 6:54am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 6:54am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 6:54am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) May 31, 2024 6:54am

Copy link
Contributor

No changes to documentation

Copy link
Member

@stipsan stipsan left a 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 🙌

Copy link
Contributor

Component Testing Report Updated May 31, 2024 7:01 AM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 39s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 7s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 14s 20 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 3s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 20s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 15s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 30s 12 0 0

@RitaDias RitaDias added this pull request to the merge queue May 31, 2024
Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beautiful

Merged via the queue into next with commit 0cefc21 May 31, 2024
44 checks passed
@RitaDias RitaDias deleted the hydration-test-fix branch May 31, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants