From 6dd8265f8513a6ec7a3cb24e4f74438e7d27d410 Mon Sep 17 00:00:00 2001 From: Blaz Pocrnja Date: Mon, 16 Mar 2020 14:29:01 -0600 Subject: [PATCH] Added more expected outputs --- test/ConnectedRouter.test.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/test/ConnectedRouter.test.js b/test/ConnectedRouter.test.js index 1a127056..7e9f4084 100644 --- a/test/ConnectedRouter.test.js +++ b/test/ConnectedRouter.test.js @@ -166,7 +166,9 @@ describe('ConnectedRouter', () => { }, action: 'PUSH', } - }) + }) + + expect(props.history.entries).toHaveLength(3) store.dispatch({ type: LOCATION_CHANGE, @@ -179,8 +181,10 @@ describe('ConnectedRouter', () => { }, action: 'PUSH', } - }) - + }) + + expect(props.history.entries).toHaveLength(3) + store.dispatch({ type: LOCATION_CHANGE, payload: { @@ -208,8 +212,11 @@ describe('ConnectedRouter', () => { mount( true} - {...props} > + stateCompareFunction={(a, b) => { + return a === undefined || (a.foo === "baz" && b.foo === 'bar') ? true : false + }} + {...props} + >
Home
} />
@@ -229,7 +236,9 @@ describe('ConnectedRouter', () => { }, action: 'PUSH', } - }) + }) + + expect(props.history.entries).toHaveLength(3) store.dispatch({ type: LOCATION_CHANGE, @@ -244,7 +253,7 @@ describe('ConnectedRouter', () => { } }) - expect(props.history.entries).toHaveLength(2) + expect(props.history.entries).toHaveLength(3) }) it('only renders one time when mounted', () => {