test(Label): Refactor Label tests to use shallow rendering - #295
Merged
jeff-phillips-18 merged 1 commit intoApr 9, 2018
Merged
Conversation
Pull Request Test Coverage Report for Build 1097
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1102
💛 - Coveralls |
priley86
reviewed
Apr 2, 2018
| expect(component.render()).toMatchSnapshot(); | ||
| test('defaults props', () => { | ||
| const view = shallow(<DisposableLabel />); | ||
| expect(view).toMatchSnapshot(); |
Member
There was a problem hiding this comment.
do you want to start using names?
i.e. toMatchSnapshot('default props snapshot')); ? or fine w/ leaving those out? sorry was confused and started using them ;)
Contributor
Author
There was a problem hiding this comment.
It definitely does not hurt. The real benefit comes from when there are multiple snapshots in 1 test. By default, they will get the test's name. If there are multiple you just get a 1 2 3 etc. I think it would be a good idea though if we are going to request them for multiple to do them for single snapshots as well. That should cut down on the question of "when should I name the snapshot". Since it will be always it is easier to remember. Will update these.
* Modified tests under Label to use shallow rendering and targeted snapshots * Removed circular dependncy for Label and DisposableLabel. This fixes importing DisposableLabel directly. * Added tests for Label and RemoveButton
dmiller9911
force-pushed
the
Tests-DisposableLabel
branch
from
April 3, 2018 13:45
f8086c9 to
dac4038
Compare
priley86
approved these changes
Apr 9, 2018
jeff-phillips-18
approved these changes
Apr 9, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Link to Storybook:
N/A
Additional issues:
N/A