Snapshot tests need IntlProvider - even when using default locales

This commit is contained in:
Vesa Luusua 2017-01-24 18:51:08 +02:00
parent c02ae5148c
commit 2a60fcdc3b
2 changed files with 9 additions and 4 deletions

View file

@ -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();

View file

@ -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>
`;