Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { shallow } from 'enzyme';
- import Text from './Text';
- const state = {
- textDetails: 'Unit Test in React with Jest - Enzyme'
- };
- it('show text value in the input text field', () => {
- const wrapper = shallow(<Text />);
- expect(wrapper.find('input[type="text"]').prop('value')).toEqual(null);
- wrapper.find('input[type="text"]').simulate('change',{target : {value: "Unit Test in React with Jest - Enzyme"}});
- expect(wrapper.find('input[type="text"]').prop('value')).toEqual("Unit Test in React with Jest - Enzyme");
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement