From 23021168e9ce5b3a35de78308f35b7bd8822084b Mon Sep 17 00:00:00 2001 From: Kim Joar Bekkelund Date: Sat, 12 Dec 2015 06:32:51 +0100 Subject: [PATCH 1/2] Failing test for --- test/createTests.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/createTests.js b/test/createTests.js index 7884160..4de7c44 100644 --- a/test/createTests.js +++ b/test/createTests.js @@ -356,6 +356,19 @@ module.exports = function createTests(createHistory, name, reset = defaultReset) }) }) + it('does not sync redux -> router 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 => { From 1770fa9388617884faa2e6f038fbb8c040863a68 Mon Sep 17 00:00:00 2001 From: Kim Joar Bekkelund Date: Sat, 12 Dec 2015 06:41:31 +0100 Subject: [PATCH 2/2] Better description --- test/createTests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/createTests.js b/test/createTests.js index 4de7c44..1464756 100644 --- a/test/createTests.js +++ b/test/createTests.js @@ -356,7 +356,7 @@ module.exports = function createTests(createHistory, name, reset = defaultReset) }) }) - it('does not sync redux -> router if `avoidRouterUpdate`', () => { + it('does not update `history` if `avoidRouterUpdate`', () => { const updates = [] const historyUnsubscribe = history.listen(location => { updates.push(location.pathname)