@kiwicom/smart-faq
Version:
29 lines (23 loc) • 796 B
JavaScript
// @flow
import * as React from 'react';
import { mount } from 'enzyme';
import { MemoryRouter } from 'react-router';
import { withRouter } from 'react-router-dom';
import { ThemeProvider } from 'styled-components';
import defaultTheme from '@kiwicom/orbit-components/lib/defaultTheme';
import { PureIntro } from '../index';
const Intro = withRouter(PureIntro);
describe('IntroPage', () => {
it('should handle login', () => {
const onLogin = jest.fn();
const wrapper = mount(
<ThemeProvider theme={defaultTheme}>
<MemoryRouter>
<Intro onLogin={onLogin} log={jest.fn()} />
</MemoryRouter>
</ThemeProvider>,
);
wrapper.find('[data-test="btn-existent-booking"]').simulate('click');
expect(onLogin).toHaveBeenCalledTimes(1);
});
});