Skip to content

Commit c0ce871

Browse files
RobbyTiptonfscgoldenjoeeparkdavidkim7773khobread
committed
Edited tests for ActionContainer to test functionality of its direct child, RouteDescription, instead of its grandchild Action. Tests still need written for RouteDescription.
Co-authored-by: Chris LeBrett <[email protected]> Co-authored-by: Robby Tipton <[email protected]> Co-authored-by: Joseph Park <[email protected]> Co-authored-by: David Kim <[email protected]> Co-authored-by: Kevin HoEun Lee <[email protected]>
1 parent 2033507 commit c0ce871

File tree

3 files changed

+194
-419
lines changed

3 files changed

+194
-419
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,9 @@
112112
"jest": "^26.1.0",
113113
"jest-cli": "^26.1.0",
114114
"jest-diff": "^26.1.0",
115-
"jest-puppeteer": "^3.4.0",
116115
"jest-runner-eslint": "^0.7.7",
117116
"jscharting-react": "^1.2.1",
118-
"puppeteer": "^1.9.0",
117+
"puppeteer": "^14.3.0",
119118
"sass": "^1.26.10",
120119
"sass-loader": "^7.3.1",
121120
"sinon-chrome": "^3.0.1",

src/app/__tests__/ActionContainer.test.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import ActionContainer from '../containers/ActionContainer';
88
import { useStoreContext } from '../store';
99
import { emptySnapshots } from '../actions/actions';
1010
import Action from '../components/Action';
11+
import RouteDescription from '../components/RouteDescription';
1112

1213
configure({ adapter: new (Adapter as any)() });
1314

@@ -76,7 +77,7 @@ const state = {
7677
}],
7778
route: {
7879
id: 4,
79-
url: 'http://localhost:8080/',
80+
url: 'http://localhost:8080/test/',
8081
},
8182
},
8283
children: [],
@@ -103,11 +104,12 @@ useStoreContext.mockImplementation(() => [state, dispatch]);
103104

104105
let wrapper;
105106

106-
//actionView={true} must be passed in to <ActionContainer /> in beforeEach() to deal with new
107-
//conditional rendering in ActionContainer that shows/hides time-travel functionality
107+
// actionView={true} must be passed in to <ActionContainer /> in beforeEach() to deal with new
108+
// conditional rendering in ActionContainer that shows/hides time-travel functionality
108109

109110
beforeEach(() => {
110111
wrapper = shallow(<ActionContainer actionView={true} />);
112+
// wrapper2 = shallow(<RouteDescription />);
111113
useStoreContext.mockClear();
112114
dispatch.mockClear();
113115
});
@@ -123,6 +125,6 @@ describe('testing the emptySnapshot button', () => {
123125
});
124126
});
125127

126-
test('number of actions should reflect snapshots array', () => {
127-
expect(wrapper.find(Action).length).toBe(state.tabs[state.currentTab].snapshots.length);
128+
test('number of RouteDescription components should reflect number of unique routes', () => {
129+
expect(wrapper.find(RouteDescription).length).toBe(2);
128130
});

0 commit comments

Comments
 (0)