Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { shallow } from 'enzyme';
- import Counter from './Counter';
- it('increments count by 1 when the increment button is clicked', () => {
- const wrapper = shallow(<Counter />);
- const incrementButton = wrapper.find('button.increment');
- incrementButton.simulate('click');
- const text = wrapper.find('h1').text();
- expect(text).toEqual('Value : 1');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement