Skip to content

Commit

Permalink
Fix with-jest and with-jest-babel example test snapshot failure (#…
Browse files Browse the repository at this point in the history
…46885)

fixes #46838

This PR fixes the snapshot test failure of examples `with-jest` and `with-jest-babel`.

I have tested by running tests in the files generated by these 2 commands: 

```
$ npx create-next-app@latest --example https://github.com/rayrw/next.js/tree/fix-with-jest-example-test-failure/examples/with-jest fix-snapshots-failure
$ npx create-next-app@latest --example https://github.com/rayrw/next.js/tree/fix-with-jest-example-test-failure/examples/with-jest-babel fix-snapshots-failure
```
  • Loading branch information
rayrw committed Mar 8, 2023
1 parent 105e5b0 commit 9a1798b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 44 deletions.
32 changes: 10 additions & 22 deletions examples/with-jest-babel/__tests__/__snapshots__/snapshot.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -86,28 +86,16 @@ exports[`renders homepage unchanged 1`] = `
<span
class="logo"
>
<span
style="box-sizing: border-box; display: inline-block; overflow: hidden; background: none; opacity: 1; border: 0px; margin: 0px; padding: 0px; position: relative; max-width: 100%;"
>
<span
style="box-sizing: border-box; display: block; background: none; opacity: 1; border: 0px; margin: 0px; padding: 0px; max-width: 100%;"
>
<img
alt=""
aria-hidden="true"
src="data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%2772%27%20height=%2716%27/%3e"
style="display: block; max-width: 100%; background: none; opacity: 1; border: 0px; margin: 0px; padding: 0px;"
/>
</span>
<img
alt="Vercel Logo"
data-nimg="intrinsic"
decoding="async"
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; box-sizing: border-box; padding: 0px; margin: auto; display: block; width: 0px; height: 0px; min-width: 100%; max-width: 100%; min-height: 100%; max-height: 100%;"
/>
<noscript />
</span>
<img
alt="Vercel Logo"
data-nimg="1"
decoding="async"
height="16"
loading="lazy"
src="/vercel.svg"
style="color: transparent;"
width="72"
/>
</span>
</a>
</footer>
Expand Down
32 changes: 10 additions & 22 deletions examples/with-jest/__tests__/__snapshots__/snapshot.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -86,28 +86,16 @@ exports[`renders homepage unchanged 1`] = `
<span
class="logo"
>
<span
style="box-sizing: border-box; display: inline-block; overflow: hidden; background: none; opacity: 1; border: 0px; margin: 0px; padding: 0px; position: relative; max-width: 100%;"
>
<span
style="box-sizing: border-box; display: block; background: none; opacity: 1; border: 0px; margin: 0px; padding: 0px; max-width: 100%;"
>
<img
alt=""
aria-hidden="true"
src="data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%2772%27%20height=%2716%27/%3e"
style="display: block; max-width: 100%; background: none; opacity: 1; border: 0px; margin: 0px; padding: 0px;"
/>
</span>
<img
alt="Vercel Logo"
data-nimg="intrinsic"
decoding="async"
src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; box-sizing: border-box; padding: 0px; margin: auto; display: block; width: 0px; height: 0px; min-width: 100%; max-width: 100%; min-height: 100%; max-height: 100%;"
/>
<noscript />
</span>
<img
alt="Vercel Logo"
data-nimg="1"
decoding="async"
height="16"
loading="lazy"
src="/vercel.svg"
style="color: transparent;"
width="72"
/>
</span>
</a>
</footer>
Expand Down

0 comments on commit 9a1798b

Please sign in to comment.