File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11/**
22 * This file re-exports @testing-library but ensures that
3- * any calls to render have translations available.
3+ * any calls to render have translations and theme available.
44 *
55 * This means tested components will be able to call
66 * `t()` and have the translations of the default
7- * language
7+ * language also components will be able to call
8+ * `prop()` and have the theming of the default theme.
89 *
9- * See : https://react.i18next.com/misc/testing#testing-without-stubbing
10+ * For i18n see : https://react.i18next.com/misc/testing#testing-without-stubbing
1011 */
1112
1213// eslint-disable-next-line import/no-extraneous-dependencies
@@ -15,15 +16,20 @@ import React from 'react';
1516import PropTypes from 'prop-types' ;
1617
1718import { I18nextProvider } from 'react-i18next' ;
19+ import { ThemeProvider } from 'styled-components' ;
20+
1821import i18n from './i18n-test' ;
22+ import theme , { Theme } from './theme' ;
1923
2024// re-export everything
2125// eslint-disable-next-line import/no-extraneous-dependencies
2226export * from '@testing-library/react' ;
2327
2428const Providers = ( { children } ) => (
2529 // eslint-disable-next-line react/jsx-filename-extension
26- < I18nextProvider i18n = { i18n } > { children } </ I18nextProvider >
30+ < ThemeProvider theme = { { ...theme [ Theme . light ] } } >
31+ < I18nextProvider i18n = { i18n } > { children } </ I18nextProvider >
32+ </ ThemeProvider >
2733) ;
2834
2935Providers . propTypes = {
You can’t perform that action at this time.
0 commit comments