From 6fee897c23b87228a31879a22fc778dec1c0bb92 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 29 Mar 2022 19:40:39 +0200 Subject: test(jest): add a test for Branding component --- __tests__/utils/test-utils.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '__tests__/utils') diff --git a/__tests__/utils/test-utils.tsx b/__tests__/utils/test-utils.tsx index e47bbe1..00123c3 100644 --- a/__tests__/utils/test-utils.tsx +++ b/__tests__/utils/test-utils.tsx @@ -1,6 +1,6 @@ import { render, RenderOptions } from '@testing-library/react'; import { ThemeProvider } from 'next-themes'; -import { FC } from 'react'; +import { FC, ReactElement } from 'react'; import { IntlProvider } from 'react-intl'; type ProvidersConfig = { @@ -8,8 +8,8 @@ type ProvidersConfig = { }; type CustomRenderOptions = { - providers: ProvidersConfig; - testingLibrary: Omit; + providers?: ProvidersConfig; + testingLibrary?: Omit; }; /** @@ -28,13 +28,13 @@ const AllTheProviders: FC = ({ children, locale = 'en' }) => { /** * Render a component with all the providers. * - * @param {JSX.Element} ui - A React component. + * @param {ReactElement} ui - A React component. * @param {CustomRenderOptions} [options] - An object of render options and providers options. * @returns A React component wrapped with all the providers. */ -const customRender = (ui: JSX.Element, options?: CustomRenderOptions) => +const customRender = (ui: ReactElement, options?: CustomRenderOptions) => render(ui, { - wrapper: () => , + wrapper: (props) => , ...options?.testingLibrary, }); -- cgit v1.2.3