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

Tests: Update PanelColor component unit tests #3797

Merged
merged 1 commit into from
Dec 4, 2017

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Dec 4, 2017

Description

Follow up for #3776.

@hideokamoto this is what I had on my mind when I said:

I feel like one snapshot test would be enough here. The second test could only validate if the title is set properly.

It turned out that color is optional rather than the title. Let me know what do you think.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

@gziolo gziolo added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Dec 4, 2017
@gziolo gziolo self-assigned this Dec 4, 2017
@hideokamoto
Copy link
Contributor

It looks like good for us :)
But I'm wandering about the snapshot returns undefined.
https://github.com/WordPress/gutenberg/pull/3797/files#diff-c01265ef188886c68e8d3a6fe8b1748cR12

Is it correctry behavior ?
Thanks !

@gziolo
Copy link
Member Author

gziolo commented Dec 4, 2017

Yes, see this line:

colorValue && <span className="components-panel__color-area" key="color" style={ { background: colorValue } } />,
. When colorValue is not provided it should return undefined. The 2nd test verifies the case when colorValue is provided. We could do the opposite, but I don't feel confident about checking if something is not present :)

@gziolo gziolo merged commit 9bfd837 into master Dec 4, 2017
@gziolo gziolo deleted the update/panel-color-test branch December 4, 2017 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants