-
Notifications
You must be signed in to change notification settings - Fork 901
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(core/presentation): Test SpinFormik touches initial values (#8248)
- Loading branch information
1 parent
840685a
commit 0b82d9d
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
app/scripts/modules/core/src/presentation/forms/SpinFormik.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }); | ||
}); | ||
}); |