Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
Add missing React router in app
Browse files Browse the repository at this point in the history
  • Loading branch information
nanovazquez committed Jun 19, 2016
1 parent 662b5f9 commit e4c3341
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 13 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Mule Match [![Build Status][1]][2] [![Coverage Status][7]][8] [![Dependency Status][3]][4] [![Dev Dependency Status][5]][6]
# Mule Match
[![Build Status][1]][2] [![Coverage Status][7]][8] [![Dependency Status][3]][4] [![Dev Dependency Status][5]][6]

[1]: https://travis-ci.org/mulesoft-labs/mule-match.svg?branch=master
[2]: https://travis-ci.org/mulesoft-labs/mule-match
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"react-addons-css-transition-group": "^15.1.0",
"react-dom": "^15.0.2",
"react-redux": "^4.4.5",
"react-router": "^2.4.1",
"redux": "^3.5.2",
"redux-actions": "^0.10.0",
"redux-promise": "^0.5.3",
Expand Down
15 changes: 9 additions & 6 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'babel-polyfill';
import React from 'react';
import { Provider } from 'react-redux';
import { Home } from 'containers';
import { configureStore } from './store';
import React from 'react';
import { Router, Route, browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import { Home } from 'containers';
import { configureStore } from './store';

// Main component for this application
const App = ({
Expand All @@ -11,8 +12,10 @@ const App = ({
}) => {
const store = configureStore({ initialState, enhancers });
return (
<Provider store={store}>
<Home />
<Provider store={store} key="provider">
<Router history={browserHistory}>
<Route path="/" component={Home} />
</Router>
</Provider>
);
};
Expand Down
6 changes: 0 additions & 6 deletions src/Playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ if (module.hot) {
module.hot.accept('./App', () => {
setTimeout(render);
});

// Enable Webpack hot module replacement for reducers
// module.hot.accept('./reducers', () => {
// const nextReducer = require('./reducers/index').default;
// store.replaceReducer(nextReducer);
// });
}

render();
4 changes: 4 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import chaiEnzyme from 'chai-enzyme';
const testsContext = require.context('./src/', true, /.*\.spec\.js$/);
testsContext.keys().forEach(testsContext);

// Require `src/App.js`
const appContext = require.context('../src/', false, /App\.js$/);
appContext.keys().forEach(appContext);

// Require `src/components/index.js`
const containersContext = require.context('../src/containers/', false, /index\.js$/);
containersContext.keys().forEach(containersContext);
Expand Down
22 changes: 22 additions & 0 deletions test/src/App.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import { shallow } from 'enzyme';
import App from 'src/App';

describe('App', () => {
let initialState;
let enhancers;
let component;

beforeEach(() => {
initialState = {};
enhancers = (createStore) => createStore;
component = shallow(
<App
initialState={initialState}
enhancers={enhancers}
/>
);
});

it('should render a component', () => component.should.exist);
});

0 comments on commit e4c3341

Please sign in to comment.