Skip to content

Commit 713f357

Browse files
committed
Added a small test for the App component
1 parent 0dcb32d commit 713f357

File tree

4 files changed

+208
-8
lines changed

4 files changed

+208
-8
lines changed

ui/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"redux-actions": "^2.2.1"
1515
},
1616
"devDependencies": {
17+
"enzyme": "^3.1.1",
18+
"enzyme-adapter-react-16": "^1.0.4",
1719
"eslint-config-react-app": "^2.0.1"
1820
},
1921
"scripts": {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import App from '../App';
2+
import NavBar from '../NavBar';
3+
import React from 'react';
4+
import { shallow } from 'enzyme';
5+
6+
describe('components/App', () => {
7+
it('renders the NavBar', () => {
8+
const wrapper = shallow(<App />);
9+
10+
expect(wrapper.find(NavBar)).toHaveLength(1);
11+
});
12+
});

ui/src/setupTests.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Adapter from 'enzyme-adapter-react-16';
2+
import { configure } from 'enzyme';
3+
4+
configure({ adapter: new Adapter() });

0 commit comments

Comments
 (0)