meriadec
7 years ago
No known key found for this signature in database
GPG Key ID: 1D2FC2305E2CB399
3 changed files with
9 additions and
5 deletions
-
src/__mocks__/render.js
-
src/helpers/staticPath.js
-
src/renderer/i18n/instanciate.js
|
|
@ -2,8 +2,10 @@ import React from 'react' |
|
|
|
import { Provider } from 'react-redux' |
|
|
|
import renderer from 'react-test-renderer' |
|
|
|
import { ThemeProvider } from 'styled-components' |
|
|
|
import { I18nextProvider } from 'react-i18next' |
|
|
|
|
|
|
|
import createStore from 'renderer/createStore' |
|
|
|
import i18n from 'renderer/i18n/electron' |
|
|
|
|
|
|
|
import theme from 'styles/theme' |
|
|
|
|
|
|
@ -11,9 +13,11 @@ export default function render(component, state) { |
|
|
|
const store = createStore({ state }) |
|
|
|
return renderer |
|
|
|
.create( |
|
|
|
<Provider store={store}> |
|
|
|
<ThemeProvider theme={theme}>{component}</ThemeProvider> |
|
|
|
</Provider>, |
|
|
|
<I18nextProvider i18n={i18n} initialLanguage="en"> |
|
|
|
<Provider store={store}> |
|
|
|
<ThemeProvider theme={theme}>{component}</ThemeProvider> |
|
|
|
</Provider> |
|
|
|
</I18nextProvider>, |
|
|
|
) |
|
|
|
.toJSON() |
|
|
|
} |
|
|
|
|
|
@ -7,4 +7,4 @@ export default (__DEV__ && !STORYBOOK_ENV && NODE_ENV !== 'test' |
|
|
|
? __static |
|
|
|
: isRunningInAsar |
|
|
|
? __dirname.replace(/app\.asar$/, 'static') |
|
|
|
: !STORYBOOK_ENV ? `${__dirname}/../static` : 'static') |
|
|
|
: !STORYBOOK_ENV ? `${__dirname}/../../static` : 'static') |
|
|
|
|
|
@ -4,7 +4,7 @@ const commonConfig = { |
|
|
|
fallbackLng: 'en', |
|
|
|
debug: false, |
|
|
|
react: { |
|
|
|
wait: true, |
|
|
|
wait: process.env.NODE_ENV !== 'test', |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|