Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Failing test for avoidRouterUpdate #118

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions test/createTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,19 @@ module.exports = function createTests(createHistory, name, reset = defaultReset)
})
})

it('does not update `history` if `avoidRouterUpdate`', () => {
const updates = []
const historyUnsubscribe = history.listen(location => {
updates.push(location.pathname)
})

store.dispatch(pushPath('/foo', null, { avoidRouterUpdate: true }))

expect(updates).toEqual([ '/' ])

historyUnsubscribe()
});

it('updates the router even if path is the same', () => {
const updates = []
const historyUnsubscribe = history.listen(location => {
Expand Down