Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import React from 'react';
  2. import { shallow } from 'enzyme';
  3. import Text from './Text';
  4.  
  5. const state = {
  6. textDetails: 'Unit Test in React with Jest - Enzyme'
  7. };
  8.  
  9. it('show text value in the input text field', () => {
  10. const wrapper = shallow(<Text />);
  11. expect(wrapper.find('input[type="text"]').prop('value')).toEqual(null);
  12. wrapper.find('input[type="text"]').simulate('change',{target : {value: "Unit Test in React with Jest - Enzyme"}});
  13. expect(wrapper.find('input[type="text"]').prop('value')).toEqual("Unit Test in React with Jest - Enzyme");
  14.  
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement