UNPKG

@kiwicom/smart-faq

Version:

Smart FAQ

30 lines (25 loc) 868 B
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var React = _interopRequireWildcard(require("react")); var _enzyme = require("enzyme"); var _index = require("../index"); // @flow jest.mock('../../../shared/helpers/analytics/cuckoo'); describe('IntroPage', function () { var props = { history: { push: jest.fn() }, location: null, onLogin: jest.fn() }; it('should match snapshot', function () { var wrapper = (0, _enzyme.shallow)(React.createElement(_index.PureIntro, props)); expect(wrapper).toMatchSnapshot(); }); it('should handle login', function () { var wrapper = (0, _enzyme.shallow)(React.createElement(_index.PureIntro, props)); wrapper.find('[dataTest="btn-existent-booking"]').simulate('click'); expect(props.onLogin).toHaveBeenCalled(); }); });