Skip to content
This repository was archived by the owner on Jan 7, 2020. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5da5dfb

Browse files
committedSep 11, 2019
add tests and missing packages
1 parent c7d077f commit 5da5dfb

15 files changed

+82
-72
lines changed
 

‎.yarnrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ lastUpdateCheck 1496303126136
66
yarn-offline-mirror "./npm-packages-offline-cache"
77
yarn-offline-mirror-pruning true
88
--install.pure-lockfile true
9-
--install.offline true
9+
--install.offline true
Binary file not shown.
307 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
5.57 KB
Binary file not shown.
17.1 KB
Binary file not shown.

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"enzyme": "3.10.0",
4040
"enzyme-adapter-react-16": "1.14.0",
4141
"eslint-plugin-prettier": "3.0.1",
42-
"eslint-plugin-react-hooks": "^1.6.0",
4342
"http-proxy-middleware": "0.19.1"
4443
}
4544
}

‎src/common/Alert.test.jsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react'
2+
import { shallow } from 'enzyme'
3+
import Alert from './Alert.jsx'
4+
5+
it('renders null Alert with no children', () => {
6+
const r = shallow(<Alert />)
7+
expect(r.find('.alert').length).toBe(0)
8+
})
9+
10+
it('renders Alert', () => {
11+
const r = shallow(<Alert><p>abc</p></Alert>)
12+
expect(r.find('.alert').length).toBe(1)
13+
expect(r.find('.alert-info').length).toBe(1)
14+
})
15+
16+
it('renders Alert with custom type', () => {
17+
const r = shallow(<Alert type="error"><p>abc</p></Alert>)
18+
expect(r.find('.alert-error').length).toBe(1)
19+
})
20+
21+
it('renders Alert with heading', () => {
22+
const r = shallow(<Alert heading="argle"><p>abc</p></Alert>)
23+
expect(r.find('h3').text()).toBe('argle')
24+
})

‎src/common/Header.test.jsx

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react'
2+
import { shallow } from 'enzyme'
3+
import Header from './Header.jsx'
4+
5+
it('renders the Header with type 1', () => {
6+
const r = shallow(<Header type={1}/>)
7+
expect(r.find('h1').length).toBe(1)
8+
})
9+
10+
it('renders the Header with provided heading text', () => {
11+
const r = shallow(<Header type={2} headingText="abc"/>)
12+
expect(r.find('h2').text()).toBe('abc')
13+
})
14+
15+
it('renders the Header with provided paragraph text', () => {
16+
const r = shallow(<Header type={3} paragraphText="123"/>)
17+
expect(r.find('p').text()).toBe('123')
18+
expect(r.find('.font-lead').length).toBe(0)
19+
})
20+
21+
it('renders the Header with provided paragraph text as lead', () => {
22+
const r = shallow(<Header type={1} paragraphText="123"/>)
23+
expect(r.find('p').text()).toBe('123')
24+
expect(r.find('.font-lead').length).toBe(1)
25+
})
26+
27+
it('renders the Header with link', () => {
28+
const r = shallow(<Header type={3} headingText="alink" headingLink="/argle"/>)
29+
expect(r.find('Link[to="/argle"]')).toBeTruthy()
30+
})
31+
32+
it('renders the disabled Header', () => {
33+
const r = shallow(<Header type={1} disabled={true}/>)
34+
expect(r.find('.disabled').length).toBe(1)
35+
})

‎src/common/LoadingIcon.test.jsx

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react'
2+
import { shallow } from 'enzyme'
3+
import LoadingIcon from './LoadingIcon.jsx'
4+
5+
it('renders default LoadingIcon', () => {
6+
const r = shallow(<LoadingIcon/>)
7+
expect(r.find('.LoadingIcon').length).toBe(1)
8+
})
9+
10+
it('renders LoadingIcon w/ custom class', () => {
11+
const r = shallow(<LoadingIcon className="argle"/>)
12+
expect(r.find('.argle').length).toBe(1)
13+
})

‎src/common/NotFound.test.jsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react'
2+
import { shallow } from 'enzyme'
3+
import NotFound from './NotFound.jsx'
4+
5+
it('renders NotFound component', () => {
6+
const r = shallow(<NotFound/>)
7+
expect(r.find('.NotFound').length).toBe(1)
8+
expect(r.find('Link').length).toBe(1)
9+
})

‎src/common/YearSelector.css

-35
This file was deleted.

‎src/common/YearSelector.jsx

-30
This file was deleted.

‎yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -3632,11 +3632,6 @@ eslint-plugin-prettier@3.0.1:
36323632
dependencies:
36333633
prettier-linter-helpers "^1.0.0"
36343634

3635-
eslint-plugin-react-hooks@^1.6.0:
3636-
version "1.6.0"
3637-
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.0.tgz#348efcda8fb426399ac7b8609607c7b4025a6f5f"
3638-
integrity sha512-lHBVRIaz5ibnIgNG07JNiAuBUeKhEf8l4etNx5vfAEwqQ5tcuK3jV9yjmopPgQDagQb7HwIuQVsE3IVcGrRnag==
3639-
36403635
eslint-plugin-react@7.12.4:
36413636
version "7.12.4"
36423637
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c"

0 commit comments

Comments
 (0)
This repository has been archived.