2019-11-23 19:41:14 +07:00
|
|
|
import { render } from '@testing-library/react';
|
|
|
|
import React from 'react';
|
2020-03-08 22:45:07 +07:00
|
|
|
import { I18nextProvider } from 'react-i18next';
|
2019-11-23 19:41:14 +07:00
|
|
|
|
2020-03-08 22:45:07 +07:00
|
|
|
import i18nConfig from '../../i18n/config';
|
2019-11-23 19:41:14 +07:00
|
|
|
import ThemeProvider from '../design-tokens/ThemeProvider';
|
|
|
|
|
|
|
|
const customRender = (node: React.ReactElement<any>, ...options: Array<any>) => {
|
2020-03-08 22:45:07 +07:00
|
|
|
return render(
|
|
|
|
<ThemeProvider>
|
|
|
|
<I18nextProvider i18n={i18nConfig}>{node}</I18nextProvider>
|
|
|
|
</ThemeProvider>,
|
|
|
|
...options
|
|
|
|
);
|
2019-11-23 19:41:14 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
export * from '@testing-library/react';
|
|
|
|
export { customRender as render };
|