diff --git a/package-lock.json b/package-lock.json index adc109cce5..52f14e5f58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "govuk-frontend": "^5.7.1", "govuk-react": "^0.10.7", "hawk": "^9.0.2", - "history": "^4.10.1", + "history": "^5.3.0", "http-proxy-middleware": "^3.0.0", "joi": "^17.13.1", "lodash": "^4.17.21", @@ -14137,16 +14137,11 @@ } }, "node_modules/history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/history/-/history-5.3.0.tgz", + "integrity": "sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==", "dependencies": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" + "@babel/runtime": "^7.7.6" } }, "node_modules/hoist-non-react-statics": { @@ -22256,11 +22251,6 @@ "node": ">=8" } }, - "node_modules/resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "node_modules/resolve-url-loader": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-5.0.0.tgz", @@ -24587,12 +24577,8 @@ "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" - }, - "node_modules/tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "dev": true }, "node_modules/tmp": { "version": "0.2.3", @@ -25376,11 +25362,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/package.json b/package.json index 0b76ad1aa6..6f69d56613 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "govuk-frontend": "^5.7.1", "govuk-react": "^0.10.7", "hawk": "^9.0.2", - "history": "^4.10.1", + "history": "^5.3.0", "http-proxy-middleware": "^3.0.0", "joi": "^17.13.1", "lodash": "^4.17.21", @@ -130,7 +130,7 @@ "react-use": "^17.5.1", "redis": "4.7.0", "redux": "^5.0.1", - "redux-first-history": "^5.2.0", + "redux-first-history": "^5.0.0", "redux-saga": "^1.3.0", "remark-gfm": "^4.0.0", "request-promise": "^4.2.6", @@ -225,4 +225,4 @@ "semver": "7.5.2", "tough-cookie": "4.1.3" } -} \ No newline at end of file +} diff --git a/test/unit-client/assets/javascripts/lib/xhr.test.js b/test/unit-client/assets/javascripts/lib/xhr.test.js index ffae4eb91b..256fc6a5a7 100644 --- a/test/unit-client/assets/javascripts/lib/xhr.test.js +++ b/test/unit-client/assets/javascripts/lib/xhr.test.js @@ -40,6 +40,10 @@ describe('XHR', () => { const res = { data: {} } const params = {} XHR.updateOutlet(res, params) + if (Object.keys(params).length > 0) { + const query = new URLSearchParams(params).toString() + history.push({ search: query }) + } expect(history.location.search).to.equal('') }) it('should perform page load if unable to pushState', () => {