From 38acabfa6089ab8ac469c12b5f55022fb96935e5 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 23 Aug 2021 16:46:06 -0300 Subject: added web vendors --- .../__tests__/TestSequences/ReplaceSamePath.js | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 history/modules/__tests__/TestSequences/ReplaceSamePath.js (limited to 'history/modules/__tests__/TestSequences/ReplaceSamePath.js') diff --git a/history/modules/__tests__/TestSequences/ReplaceSamePath.js b/history/modules/__tests__/TestSequences/ReplaceSamePath.js new file mode 100644 index 0000000..2dd7ce3 --- /dev/null +++ b/history/modules/__tests__/TestSequences/ReplaceSamePath.js @@ -0,0 +1,37 @@ +import expect from 'expect'; + +import execSteps from './execSteps.js'; + +export default function(history, done) { + let prevLocation; + + const steps = [ + location => { + expect(location).toMatchObject({ + pathname: '/' + }); + + history.replace('/home'); + }, + (location, action) => { + expect(action).toBe('REPLACE'); + expect(location).toMatchObject({ + pathname: '/home' + }); + + prevLocation = location; + + history.replace('/home'); + }, + (location, action) => { + expect(action).toBe('REPLACE'); + expect(location).toMatchObject({ + pathname: '/home' + }); + + expect(location).not.toBe(prevLocation); + } + ]; + + execSteps(steps, history, done); +} -- cgit v1.2.3