enzyme get component method code example
Example 1: enzyme test method
const wrapper = shallow(<Button />);
wrapper.instance().handleClick()
Example 2: test one function in react class
expect(wrapper.instance().checkBoxChecked()).equals(true);
const wrapper = shallow(<Button />);
wrapper.instance().handleClick()
expect(wrapper.instance().checkBoxChecked()).equals(true);