react-ocean-forms
Version:
Forms components for react based on the context api.
18 lines (17 loc) • 753 B
TypeScript
import { IFormContext } from '../components/FormContext';
import { IValidationProp } from '../components/withValidation';
/**
* Components inside the form module require access to the form context.
* This is not available when mounting single components in Enzyme.
* These helper functions aim to address that and wrap a valid,
* user definable form context around them.
*/
/**
* Creates a form context
*/
export declare const createMockFormContext: (registerCallback?: Function | undefined) => IFormContext<import("../components/FormContext").IFieldValues>;
/**
* Creates a validation object mocking the
* withValidation hoc
*/
export declare const createMockValidation: () => IValidationProp<import("..").TBasicFieldValue>;