Skip to content

Commit

Permalink
refactor: migrate form-fields file
Browse files Browse the repository at this point in the history
  • Loading branch information
likhith-deriv committed Aug 15, 2023
1 parent c0a1dfa commit cde6f27
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { Formik } from 'formik';
import { render, screen } from '@testing-library/react';
import DateOfBirthField from '../date-of-birth-field';

describe('Tesing <DateOfBirthField/> component', () => {
it('should render properties', () => {
const props = {
name: 'test-name',
portal_id: 'test-portal-id',
};
render(
<Formik initialValues={{}} onSubmit={jest.fn()}>
<DateOfBirthField {...props} />
</Formik>
);

expect(screen.getByRole('textbox')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Formik } from 'formik';
import { render, screen } from '@testing-library/react';
import FormInputField from '../form-input-field';
import { Formik } from 'formik';

describe('Tesing <FormInputField/> component', () => {
it('should render properties', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { toMoment } from '@deriv/shared';
type TDateOfBirthFieldProps = {
name: string;
portal_id: string;
} & React.ComponentProps<typeof DateOfBirthPicker>;
} & Omit<React.ComponentProps<typeof DateOfBirthPicker>, 'onBlur' | 'onChange' | 'error'>;

type TDateOfBirthFieldHelpers = {
field: FieldInputProps<string | moment.Moment>;
Expand Down
File renamed without changes.

0 comments on commit cde6f27

Please sign in to comment.