Created
September 16, 2018 11:27
-
-
Save productioncoder/b8871700c45276a6553237d259a2fe4a to your computer and use it in GitHub Desktop.
Testing Youtube AppLayout component
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 {AppLayout} from '../AppLayout'; | |
test('renders empty <AppLayout/>', () => { | |
const wrapper = shallow( | |
<AppLayout/> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
test('renders <AppLayout/> with one child', () => { | |
const wrapper = shallow( | |
<AppLayout> | |
<div>Child 1</div> | |
</AppLayout> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); | |
test('renders <AppLayout/> with children', () => { | |
const wrapper = shallow( | |
<AppLayout> | |
<div>Child</div> | |
<div> | |
<span>Child</span> | |
<p>Child</p> | |
</div> | |
</AppLayout> | |
); | |
expect(wrapper).toMatchSnapshot(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment