Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tests for VideoGrid and VideoGridHeader
import React from 'react';
import {shallow} from 'enzyme';
import {VideoGrid} from '../VideoGrid';
describe('VideoGrid', () => {
test('renders without props', () => {
const wrapper = shallow(<VideoGrid/>);
expect(wrapper).toMatchSnapshot();
});
test('renders with title prop', () => {
const wrapper = shallow(<VideoGrid title='Trending'/>);
expect(wrapper).toMatchSnapshot();
});
test('renders without divider', () => {
const wrapper = shallow(<VideoGrid hideDivider={true}/>);
expect(wrapper).toMatchSnapshot();
});
});
import React from 'react';
import {shallow} from 'enzyme';
import {VideoGridHeader} from '../VideoGridHeader';
describe('VideoGridHeader', () => {
test('renders without props', () => {
const wrapper = shallow(<VideoGridHeader/>);
expect(wrapper).toMatchSnapshot();
});
test('renders with empty string header', () => {
const wrapper = shallow(<VideoGridHeader title=''/>);
expect(wrapper).toMatchSnapshot();
});
test('renders with title', () => {
const wrapper = shallow(<VideoGridHeader title='Autos & Vehicles'/>);
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.