mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
28 lines
891 B
JavaScript
28 lines
891 B
JavaScript
import React from 'react';
|
|
import {mountWithIntl} from '../../helpers/intl-helpers.jsx';
|
|
import FormikInput from '../../../src/components/formik-forms/formik-input.jsx';
|
|
import {Formik} from 'formik';
|
|
|
|
describe('FormikInput', () => {
|
|
test('No validation message without an error', () => {
|
|
const component = mountWithIntl(
|
|
<Formik>
|
|
<FormikInput
|
|
error=""
|
|
/>
|
|
</Formik>
|
|
);
|
|
expect(component.find('ValidationMessage').exists()).toEqual(false);
|
|
});
|
|
|
|
test('Validation message shown when error given', () => {
|
|
const component = mountWithIntl(
|
|
<Formik>
|
|
<FormikInput
|
|
error="There was an error"
|
|
/>
|
|
</Formik>
|
|
);
|
|
expect(component.find('ValidationMessage').exists()).toEqual(true);
|
|
});
|
|
});
|