diff --git a/frontend/src/components/UserForm.test.js b/frontend/src/components/UserForm.test.js index 4c9ee6c..87639ec 100644 --- a/frontend/src/components/UserForm.test.js +++ b/frontend/src/components/UserForm.test.js @@ -7,6 +7,25 @@ import React from 'react'; import { ExtendedUserForm as UserForm } from './UserForm'; describe('', () => { + + describe('submit', () => { + test('correctly submitted', () => { + const onSubmit = jest.fn(); + const form = mount(); + + form.find('[name="username"]').simulate('change', { target: { value: 'test' } }); + form.find('[name="password"]').simulate('change', { target: { value: 'test' } }); + form.find('[name="passwordVerification"]').simulate('change', { target: { value: 'test' } }); + form.find('form').simulate('submit'); + + expect(onSubmit).toHaveBeenCalledWith({ + username: 'test', + password: 'test', + passwordVerification: 'test' + }); + }) + }); + describe('username validation', () => { test('empty username', () => {