Fix failing test by using shallow instead of mount
Found the solution here: https://github.com/airbnb/enzyme/issues/1253
| | |
| | | import React from 'react'; // eslint-disable-line no-unused-vars |
| | | import { mount } from 'enzyme'; |
| | | import { mount, shallow } from 'enzyme'; |
| | | import Datetime from '../DateTime'; // eslint-disable-line no-unused-vars |
| | | |
| | | const simulateClickOnElement = (element) => { |
| | |
| | | return mount(<Datetime {...props} />); |
| | | }, |
| | | |
| | | createDatetimeShallow: (props) => { |
| | | return shallow(<Datetime {...props} />); |
| | | }, |
| | | |
| | | /* |
| | | * Click Simulations |
| | | */ |
| | |
| | | expect(utils.isTimeView(component)).toBeTruthy(); |
| | | }); |
| | | |
| | | xit('className -> type string', () => { |
| | | const component = utils.createDatetime({ className: 'custom-class' }); |
| | | it('className -> type string', () => { |
| | | const component = utils.createDatetimeShallow({ className: 'custom-class' }); |
| | | expect(component.find('.custom-class').length).toEqual(1); |
| | | }); |
| | | |