UNPKG

@kiwicom/smart-faq

Version:

Smart FAQ

29 lines (23 loc) 673 B
// @flow import * as React from 'react'; import { shallow } from 'enzyme'; import { PureIntro } from '../index'; jest.mock('../../../shared/helpers/analytics/cuckoo'); describe('IntroPage', () => { const props = { history: { push: jest.fn(), }, location: null, onLogin: jest.fn(), }; it('should match snapshot', () => { const wrapper = shallow(<PureIntro {...props} />); expect(wrapper).toMatchSnapshot(); }); it('should handle login', () => { const wrapper = shallow(<PureIntro {...props} />); wrapper.find('[dataTest="btn-existent-booking"]').simulate('click'); expect(props.onLogin).toHaveBeenCalled(); }); });