Created
October 3, 2018 13:33
-
-
Save productioncoder/e8471951aeee2a4313d5b944e23607aa to your computer and use it in GitHub Desktop.
Youtube Comments and CommentsHeader snapshot test
This file contains 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
import React from 'react'; | |
import {shallow} from 'enzyme'; | |
import {Comments} from '../Comments'; | |
describe('Comments', () => { | |
test('renders without props', () => { | |
const wrapper = shallow( | |
<Comments/> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
test('renders without amountComments', () => { | |
const wrapper = shallow( | |
<Comments amountComments={112499}/> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
}); | |
This file contains 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
import React from 'react'; | |
import {shallow} from 'enzyme'; | |
import {CommentsHeader} from '../CommentsHeader'; | |
describe('CommentsHeader', () => { | |
test('CommentsHeader renders with props.amountComments = null', () => { | |
const wrapper = shallow( | |
<CommentsHeader/> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
test('CommentsHeader renders with props.amountComments = 0', () => { | |
const wrapper = shallow( | |
<CommentsHeader amountComments={123}/> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment