Last active
August 22, 2018 12:02
-
-
Save erezLieberman/fec54d616915d7c7e58c9bde4fa20eec to your computer and use it in GitHub Desktop.
Basic for test component method in react + jest + enzyme because our decorator
This file contains hidden or 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 _ from 'lodash'; | |
import { mount, shallow } from 'enzyme'; | |
import NameOfComponent from '../src/NameOfComponent'; | |
describe('NameOfComponent Basic: ', () => { | |
it('should verified that component is exits', () => { | |
const wrapper = mount( | |
<NameOfComponent /> | |
); | |
expect(wrapper).toHaveLength(1); | |
}); | |
it('should verified that method name component works as as expected', () => { | |
const wrapper = mount(shallow(<NameOfComponent propsname={200} />).get(0)); | |
expect(wrapper.instance().methodName()).toEqual(someValue); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment