Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created October 3, 2018 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/e8471951aeee2a4313d5b944e23607aa to your computer and use it in GitHub Desktop.
Save productioncoder/e8471951aeee2a4313d5b944e23607aa to your computer and use it in GitHub Desktop.
Youtube Comments and CommentsHeader snapshot test
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();
});
});
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