Make react-test usable without styled-components

This commit is contained in:
Jerko Steiner 2020-01-09 10:45:23 +01:00
parent e86c8b9226
commit 12515eac74

View File

@ -114,9 +114,15 @@ export class TestUtils {
const component: TestContainer | null = await new Promise(resolve => {
ReactDOM.render(
<TestContainer ref={instance => resolve(instance)}>
<ThemeProvider theme={TestUtils.defaultTheme}>
{jsx}
</ThemeProvider>
{
TestUtils.defaultTheme
? (
<ThemeProvider theme={TestUtils.defaultTheme}>
{jsx}
</ThemeProvider>
)
: jsx
}
</TestContainer>,
$div,
)