Skip to content

Commit

Permalink
Added more expected outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
BlazPocrnja committed Mar 21, 2020
1 parent e68defe commit 6dd8265
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions test/ConnectedRouter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ describe('ConnectedRouter', () => {
},
action: 'PUSH',
}
})
})

expect(props.history.entries).toHaveLength(3)

store.dispatch({
type: LOCATION_CHANGE,
Expand All @@ -179,8 +181,10 @@ describe('ConnectedRouter', () => {
},
action: 'PUSH',
}
})

})

expect(props.history.entries).toHaveLength(3)

store.dispatch({
type: LOCATION_CHANGE,
payload: {
Expand Down Expand Up @@ -208,8 +212,11 @@ describe('ConnectedRouter', () => {
mount(
<Provider store={store}>
<ConnectedRouter
stateCompareFunction={() => true}
{...props} >
stateCompareFunction={(a, b) => {
return a === undefined || (a.foo === "baz" && b.foo === 'bar') ? true : false
}}
{...props}
>
<Route path="/" render={() => <div>Home</div>} />
</ConnectedRouter>
</Provider>
Expand All @@ -229,7 +236,9 @@ describe('ConnectedRouter', () => {
},
action: 'PUSH',
}
})
})

expect(props.history.entries).toHaveLength(3)

store.dispatch({
type: LOCATION_CHANGE,
Expand All @@ -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', () => {
Expand Down

0 comments on commit 6dd8265

Please sign in to comment.