Skip to content

Commit

Permalink
chore(navbar):create nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
timi-codes committed Aug 14, 2019
1 parent f23efa1 commit cef1639
Show file tree
Hide file tree
Showing 64 changed files with 1,927 additions and 456 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = {
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
SharedArrayBuffer: 'readonly',
shallow: true,
mount: true,
expect: true,
Expand Down
1 change: 0 additions & 1 deletion __mocks__/fileMock.js

This file was deleted.

85 changes: 85 additions & 0 deletions __test__/App.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import React from 'react';
import { createStore, combineReducers } from 'redux';
import { BrowserRouter, Switch } from 'react-router-dom';
import { Provider } from 'react-redux';
import auth from '@modules/auth/reducer';
import LoginPage from '@pages/loginPage';
import HomePage from '@pages/homePage';
import NotFoundPage from '@pages/notFoundPage';
import Menu from '../src/components/userMenu';
import Footer from '../src/components/Footer/index';
import App from '../src/routes/AppRouter';

describe('Application test', () => {
let store;

beforeEach(() => {
store = createStore(
combineReducers({
auth
})
);
});
it('should render index page', () => {
const comp = (
<Provider store={store}>
<BrowserRouter>
<Switch>
<App dispatch={jest.fn()} />
</Switch>
</BrowserRouter>
</Provider>
);
const wrapper = mount(comp);

expect(wrapper.find('Home')).toBeTruthy();
});
it('should not crash app', () => {
const wrapper = mount(<App />);

expect(toJson(wrapper)).toMatchSnapshot();
});
it('should work fine on Login Page', () => {
const wrapper = mount(
<BrowserRouter>
<LoginPage />
</BrowserRouter>
);

expect(toJson(wrapper)).toMatchSnapshot();
});
it('should work fine Home Page', () => {
const wrapper = mount(
<BrowserRouter>
<HomePage />
</BrowserRouter>
);

expect(toJson(wrapper)).toMatchSnapshot();
});

it('should work fine Home Page', () => {
const wrapper = mount(
<BrowserRouter>
<NotFoundPage />
</BrowserRouter>
);

expect(toJson(wrapper)).toMatchSnapshot();
});

it('should render without crashing', () => {
const wrapper = mount(<Menu />);

expect(toJson(wrapper)).toMatchSnapshot();
expect(wrapper.find('[href="/"]')).toHaveLength(4);
expect(wrapper.find('a').length).toBeGreaterThan(1);
expect(wrapper.find('ul')).toHaveLength(1);
expect(wrapper.find('li').length).toBeGreaterThan(1);
});
it('should render without crashing', () => {
const wrapper = shallow(<Footer />);

expect(toJson(wrapper)).toMatchSnapshot();
});
});
1 change: 1 addition & 0 deletions __test__/__mock__/localStorage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {};
1 change: 1 addition & 0 deletions __test__/__mock__/svgrMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'icon-mock';
Loading

0 comments on commit cef1639

Please sign in to comment.