Created
September 15, 2018 19:20
-
-
Save productioncoder/0fb09562b1d5678185419b6f5c66bfd0 to your computer and use it in GitHub Desktop.
Tests for VideoGrid and VideoGridHeader
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 {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(); | |
}); | |
}); |
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 {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