import React from 'react' ; import { render } from '@testing-library/react' ; import { RootProvider } from 'contexts/RootProvider' ; import { DayPickerProps } from 'types/DayPicker' ; /** Render a React Element wrapped with the Root Provider. */ export function customRender ( /** The element to render. */ element , /** The initial DayPicker props to pass to the Root Provider. */ dayPickerProps = { } ) { return render ( < RootProvider { ... dayPickerProps } > { element } < /RootProvider>); }