Skip to content

Commit 8c78fbd

Browse files
authored
Merge pull request #10 from Stackup-Rwanda/ft-landing-page-172990691
#172990691 Landing Page
2 parents bcf9180 + e8dfb5c commit 8c78fbd

File tree

27 files changed

+13476
-142
lines changed

27 files changed

+13476
-142
lines changed

.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
".jsx"
3232
]
3333
}
34-
]
34+
],
35+
"react/no-array-index-key": 0,
36+
"jsx-a11y/anchor-is-valid": 0
3537
}
3638
}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ build
1616

1717
#caches
1818
package-lock.json
19-
yarn.lock
2019
yarn-error.log
2120

2221
#test coverage

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
3. [sass-loader](https://www.npmjs.com/package/sass-loader)
3131
4. [Storybook](https://storybook.js.org/docs/guides/guide-react/)
3232
5. [Enzyme](https://enzymejs.github.io/enzyme/)
33+
6. [Material-UI](https://material-ui.com/)
3334

3435
### E. Deployments
3536
- This application is deployed on heroku, we have two different versions, which are different by the app status, in staging mode or ready for production.
@@ -38,6 +39,3 @@
3839

3940
- When the app is ready for production is available on this link `https://immense-chamber-27847.herokuapp.com/`
4041
- Whenever a new PR is opened, there is a new review app which is created and accessible in the browser which helps to access visualize your PR in the browser to check if it working as you wanted it to work.
41-
42-
43-

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@
3535
"dependencies": {
3636
"@babel/core": "^7.9.6",
3737
"@babel/preset-react": "^7.9.4",
38+
"@material-ui/core": "^4.10.0",
39+
"@material-ui/icons": "^4.9.1",
3840
"@storybook/addon-actions": "^5.3.18",
3941
"@storybook/addon-links": "^5.3.18",
4042
"@storybook/addons": "^5.3.18",
4143
"@storybook/react": "^5.3.18",
44+
"@testing-library/react": "^10.0.4",
45+
"babel-eslint": "^10.1.0",
4246
"babel-jest": "^26.0.1",
4347
"babel-loader": "^8.1.0",
4448
"babel-plugin-transform-class-properties": "^6.24.1",

public/index.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Barefoot nomad</title>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" />
7+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
8+
<title>Barefoot Nomad - We make company global travel and accommodation easy and convinient</title>
79
</head>
10+
811
<body>
9-
<div id="root"></div>
10-
<script type="text/javascript" src="barefoot-nomad-build.js"></script>
12+
<div id="root"></div>
13+
<script type="text/javascript" src="barefoot-nomad-build.js"></script>
1114
</body>
12-
</html>
15+
16+
</html>

src/__tests__/App.test.js

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,29 @@
1+
/* eslint-disable no-unused-vars */
12
/* eslint-disable no-undef */
23
import { mount, shallow } from 'enzyme';
34
import React from 'react';
45
import { Provider } from 'react-redux';
56
import renderer from 'react-test-renderer';
67
import configureStore from 'redux-mock-store';
7-
import customMessage from '../utils/customMessages';
88
import App from '../entry/App';
9-
import HelloComponent from '../components/HelloComponent';
10-
import FrontPage from '../views/frontPage';
9+
import LandingPage from '../views/LandingPage/LandingPage';
1110
import reducer from '../reducers/reducer';
1211
import firstMessage from '../actions/actions';
1312

14-
let component = '';
15-
1613
const mockStore = configureStore([]);
1714
const store = mockStore({
1815
message: 'Welcome',
1916
});
2017
store.dispatch = jest.fn();
21-
component = renderer.create(
18+
const component = renderer.create(
2219
<Provider store={store}>
23-
<HelloComponent />
20+
<LandingPage />
2421
</Provider>,
2522
);
2623
describe('App tests', () => {
2724
it('Will prove that the app is rendered from App component', () => {
2825
const appRender = shallow(<App />);
29-
expect(appRender.contains(<HelloComponent />));
30-
});
31-
32-
it('Will show the home page', () => {
33-
const homePage = mount(<Provider store={store}><HelloComponent /></Provider>);
34-
expect(homePage.text()).toEqual(`${customMessage.welcomeToBarefootNomad}Welcometry redux`);
35-
});
36-
37-
it('Will show the front page', () => {
38-
const frontPage = mount(<FrontPage />);
39-
expect(frontPage.text()).toEqual('Welcome to React appreact router dom is well configured!!!');
26+
expect(appRender.contains(<LandingPage />));
4027
});
4128

4229
it('should return welcome when no action provided', () => {
@@ -45,10 +32,4 @@ describe('App tests', () => {
4532
it('should return Redux when action is provided with value', () => {
4633
expect(reducer(undefined, { ...firstMessage, value: 'Redux' })).toEqual({ message: 'Redux' });
4734
});
48-
it('should dispatch an action on button click', () => {
49-
renderer.act(() => {
50-
component.root.findByType('button').props.onClick();
51-
});
52-
expect(store.dispatch).toHaveBeenCalledTimes(1);
53-
});
5435
});

src/__tests__/NavBar.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* eslint-disable no-undef */
2+
import React from 'react';
3+
import renderer from 'react-test-renderer';
4+
import { cleanup } from '@testing-library/react';
5+
import NavBar from '../views/NavBar/NavBar';
6+
7+
describe('<NavBar/>', () => {
8+
afterEach(cleanup);
9+
it('Should match the NavBar component snapshot', () => {
10+
const tree = renderer.create(<NavBar />).toJSON();
11+
expect(tree).toMatchSnapshot();
12+
});
13+
});
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`<NavBar/> Should match the NavBar component snapshot 1`] = `
4+
<div
5+
className="makeStyles-root-1"
6+
>
7+
<header
8+
className="MuiPaper-root MuiAppBar-root MuiAppBar-positionStatic MuiAppBar-colorPrimary navbar MuiPaper-elevation4"
9+
>
10+
<div
11+
className="MuiToolbar-root MuiToolbar-regular navbar-content MuiToolbar-gutters"
12+
>
13+
<div
14+
className="brand"
15+
>
16+
<h2
17+
className="brand-barefoot"
18+
>
19+
Barefoot
20+
</h2>
21+
<h2
22+
className="brand-nomad"
23+
>
24+
Nomad
25+
</h2>
26+
</div>
27+
<div
28+
className="brand"
29+
>
30+
<a
31+
className="MuiTypography-root MuiLink-root MuiLink-underlineHover navlink MuiTypography-colorPrimary"
32+
href="/login"
33+
onBlur={[Function]}
34+
onFocus={[Function]}
35+
>
36+
Login
37+
</a>
38+
<a
39+
className="MuiTypography-root MuiLink-root MuiLink-underlineHover navlink navlink-signup MuiTypography-colorTextPrimary"
40+
href="/signup"
41+
onBlur={[Function]}
42+
onFocus={[Function]}
43+
>
44+
Create account
45+
</a>
46+
</div>
47+
</div>
48+
</header>
49+
</div>
50+
`;

src/assets/images/landing_background.svg

Lines changed: 9 additions & 0 deletions
Loading

src/assets/images/ready_travel_background.svg

Lines changed: 9 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)