Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.