mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Snapshot tests need IntlProvider - even when using default locales
This commit is contained in:
parent
c02ae5148c
commit
2a60fcdc3b
2 changed files with 9 additions and 4 deletions
|
|
@ -1,15 +1,18 @@
|
|||
import React from 'react';
|
||||
import { BrowserRouter } from 'react-router';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
import LandingPage from './LandingPage';
|
||||
|
||||
describe('LandingPage', () => {
|
||||
it('matches snapshot', () => {
|
||||
const component = renderer.create(
|
||||
(
|
||||
<BrowserRouter>
|
||||
<LandingPage />
|
||||
</BrowserRouter>
|
||||
<IntlProvider locale="en">
|
||||
<BrowserRouter>
|
||||
<LandingPage />
|
||||
</BrowserRouter>
|
||||
</IntlProvider>
|
||||
),
|
||||
);
|
||||
const tree = component.toJSON();
|
||||
|
|
|
|||
|
|
@ -128,7 +128,9 @@ exports[`LandingPage matches snapshot 1`] = `
|
|||
href="/s?location=helsinki"
|
||||
onClick={[Function]}
|
||||
style={Object {}}>
|
||||
Find studios
|
||||
<span>
|
||||
Show nice studios! (default)
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
`;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue