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

Fix/2139 jest snapshots #2233

Merged
merged 10 commits into from
Feb 8, 2021
Merged

Conversation

ajs139
Copy link
Contributor

@ajs139 ajs139 commented Jan 29, 2021

What:

Fix #2139 - Snapshot serializer is not replacing hashes.

Why:

When creating snapshots for components that have an array as the css property, the snapshot was outputting some of the internal properties. Additionally, there was a problem with the serialization when using mount on components that had the css properties on child components.

How:

Fixed a bug where the component wasn't being unwrapped properly (so its children were not being modified).
Accounted for the css prop being an array.

Checklist:

  • Documentation N/A
  • Tests
  • Code complete
  • Changeset

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2021

🦋 Changeset detected

Latest commit: b6349ab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@emotion/jest Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 29, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b6349ab:

Sandbox Source
Emotion Configuration

yarn.lock Outdated Show resolved Hide resolved
@ajs139 ajs139 force-pushed the fix/2139_jest_snapshots branch 2 times, most recently from c38a0ab to 3688495 Compare January 29, 2021 22:14
…t has css prop

(cherry picked from commit 2c32d546ad206a2ab255ef93f7bdf2e2a136dcf7)
(cherry picked from commit 2a1a68424e8eb9a7c38b637f2a639024c667401b)
(cherry picked from commit 2460754)
(cherry picked from commit 7d3eb7942f798621c2e374fc9fa0fae8b555dd16)
@ajs139 ajs139 force-pushed the fix/2139_jest_snapshots branch from 3688495 to 217312e Compare January 29, 2021 22:17
@@ -191,6 +204,25 @@ describe('enzyme', () => {
cases
)

test('child containing css array property', () => {
Copy link
Member

Choose a reason for hiding this comment

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

is this the correct test title? no css prop here holds an array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated, as noted the titles got switched

@@ -143,6 +143,19 @@ const cases = {
)
}
},
'using the css helper': {
Copy link
Member

Choose a reason for hiding this comment

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

OTOH this one holds an array so I would assume that maybe the added test titles should be swapped but I'm also not sure what "using the css helper" test would be about - could you make this test title a little bit more descriptive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, let me know if the new description is missing anything

@Andarist Andarist merged commit 0c31ed0 into emotion-js:master Feb 8, 2021
@github-actions github-actions bot mentioned this pull request Feb 8, 2021
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.

@emotion/jest - Snapshot serializer is not replacing hashes
2 participants