File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* 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.
4
4
*
5
5
* This means tested components will be able to call
6
6
* `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.
8
9
*
9
- * See : https://react.i18next.com/misc/testing#testing-without-stubbing
10
+ * For i18n see : https://react.i18next.com/misc/testing#testing-without-stubbing
10
11
*/
11
12
12
13
// eslint-disable-next-line import/no-extraneous-dependencies
@@ -15,15 +16,20 @@ import React from 'react';
15
16
import PropTypes from 'prop-types' ;
16
17
17
18
import { I18nextProvider } from 'react-i18next' ;
19
+ import { ThemeProvider } from 'styled-components' ;
20
+
18
21
import i18n from './i18n-test' ;
22
+ import theme , { Theme } from './theme' ;
19
23
20
24
// re-export everything
21
25
// eslint-disable-next-line import/no-extraneous-dependencies
22
26
export * from '@testing-library/react' ;
23
27
24
28
const Providers = ( { children } ) => (
25
29
// 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 >
27
33
) ;
28
34
29
35
Providers . propTypes = {
You can’t perform that action at this time.
0 commit comments