import React from 'react'; import AuthenticationPage from './AuthenticationPage'; import {shallow} from 'enzyme'; describe('', function () { it('renders without crashing ', function () { const wrapper = shallow( {}}/>); wrapper.unmount(); }); it('test button click', function () { let pass; const func = jest.fn((pwd) => {pass = pwd}); const wrapper = shallow(); wrapper.setState({pwdText: 'testpwd'}); wrapper.find('Button').simulate('click'); expect(func).toHaveBeenCalledTimes(1); expect(pass).toBe('testpwd'); }); });