/** Field input value, name, and event handlers */
export interface FieldInputProps<Value> {
/** Value of the field */
value: Value;
/** Name of the field */
name: string;
/** Multiple select? */
multiple?: boolean;
/** Is the field checked? */
checked?: boolean;
/** Change event handler */
onChange: FormikHandlers['handleChange'];
/** Blur event handler */
onBlur: FormikHandlers['handleBlur'];
}
import {render} from '@testing-library/react';
import React from 'react';
import type {FieldInputProps} from 'formik';
describe('test group', () => {
it('test', async () => {
const fieldStub: FieldInputProps<string> = {
value: '...',
name: 'name',
onChange: jest.fn(),
onBlur: jest.fn(),
};
const result = render(
<Checkbox field={fieldStub} label={'label'} />
);
expect(...).toBe***(...);
});
});
преобразуй binary string в arraybuffer и передавай в конструктор blob
SOLID обычно применяется к ооп