Created
April 23, 2021 23:33
-
-
Save takahirohonda/667158d2f2e3178bbfe24b78a7e201ff to your computer and use it in GitHub Desktop.
wrapper-test.jsx
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 { mount, shallow } from 'enzyme'; | |
import Wrapper from '.'; | |
describe('<Wrapper />', () => { | |
test('renders with correct className with mount', () => { | |
const wrapper = mount(<Wrapper>Children here</Wrapper>); | |
console.log(wrapper.debug()); | |
expect(wrapper.find('div').hasClass('wrapper')).toBeTruthy(); | |
}); | |
test('renders with correct className with shallow', () => { | |
const wrapper = shallow(<Wrapper>Children here</Wrapper>); | |
console.log(wrapper.debug()); | |
expect(wrapper.hasClass('wrapper')).toBeTruthy(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment