UNPKG

xchain-components

Version:
27 lines (22 loc) 627 B
/* eslint react/jsx-filename-extension: 0 */ import React from 'react'; import { shallow } from 'enzyme'; import XForm from '..'; import XInput from 'components/XInput'; const onFormSubmit = jest.fn(); describe('XForm', () => { it('Login Form', () => { const userName = <XInput placeholder="UserName" />; const password = <XInput placeholder="Password" />; const formFields = [ userName, password, ]; const component = shallow(<XForm formFields={formFields} submitButtonText="Login" onFormSubmit={onFormSubmit} />); expect(component).toMatchSnapshot(); }); });