Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
chore(examples): use real location object in react-router example (#1349
Browse files Browse the repository at this point in the history
)

* use real location object in example app test
  • Loading branch information
yotammanor authored and samouss committed Jun 19, 2018
1 parent 625ec1b commit 971dca6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"identity-obj-proxy": "3.0.0",
"jest-environment-jsdom-11.0.0": "20.1.9",
"react-scripts": "1.1.0",
"react-test-renderer": "16.2.0"
"react-test-renderer": "16.2.0",
"history": "^4.7.2"
},
"dependencies": {
"instantsearch.css": "7.0.0",
Expand Down
8 changes: 5 additions & 3 deletions examples/react-router/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react';
import renderer from 'react-test-renderer';
import App from './App';
import { createMemoryHistory } from 'history';

const history = createMemoryHistory('/');
const { location } = history;

describe('react-router recipe', () => {
it('App renders without crashing', () => {
const component = renderer.create(
<App location={{ search: { slice: jest.fn() } }} />
);
const component = renderer.create(<App location={location} />);

expect(component.toJSON()).toMatchSnapshot();
});
Expand Down

0 comments on commit 971dca6

Please sign in to comment.