Skip to content

Commit

Permalink
test(core/presentation): Test SpinFormik touches initial values (#8248)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed May 6, 2020
1 parent 840685a commit 0b82d9d
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { mount } from 'enzyme';
import { FormikProps } from 'formik';
import { SpinFormik } from './SpinFormik';

describe('SpinFormik', () => {
it('touches all fields in initialValues', () => {
let formik: FormikProps<any> = null;

mount(
<SpinFormik
initialValues={{ foo: '123', bar: '456' }}
onSubmit={() => null}
render={_formik => {
formik = _formik;
return null;
}}
/>,
);

expect(formik.touched).toEqual({ foo: true, bar: true });
});
});

0 comments on commit 0b82d9d

Please sign in to comment.