-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f23efa1
commit cef1639
Showing
64 changed files
with
1,927 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = 'icon-mock'; |
Oops, something went wrong.