mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 11:59:48 -04:00
Revert recent changes for window location updates
There are a few other things at play that will require more investigation at a future date: - Why window.location.assign() or history.pushState() do not work - If any other config or polyfills are needed with JSDOM Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
@@ -27,11 +27,12 @@ window.GOVUK.Modules.TimeoutPopup = window.GOVUK.Modules.TimeoutPopup || {};
|
|||||||
|
|
||||||
function expireUserSession() {
|
function expireUserSession() {
|
||||||
var signOutLink = '/sign-out?next=' + window.location.pathname;
|
var signOutLink = '/sign-out?next=' + window.location.pathname;
|
||||||
window.location.assign(signOutLink);
|
window.location.href = signOutLink;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function signoutUser() {
|
function signoutUser() {
|
||||||
window.location.assign('/sign-out');
|
window.location.href = '/sign-out';
|
||||||
}
|
}
|
||||||
|
|
||||||
function extendSession() {
|
function extendSession() {
|
||||||
|
|||||||
@@ -12,6 +12,6 @@ module.exports = {
|
|||||||
setupFiles: ['./support/setup.js'],
|
setupFiles: ['./support/setup.js'],
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
testEnvironmentOptions: {
|
testEnvironmentOptions: {
|
||||||
url: 'https://www.notifications.service.gov.uk',
|
url: 'https://beta.notify.gov',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
let _location = {
|
let _location = {
|
||||||
reload: jest.fn(),
|
reload: jest.fn(),
|
||||||
hostname: "www.notifications.service.gov.uk",
|
hostname: "beta.notify.gov",
|
||||||
assign: jest.fn(),
|
assign: jest.fn(),
|
||||||
href: "https://www.notifications.service.gov.uk",
|
href: "https://beta.notify.gov",
|
||||||
}
|
}
|
||||||
|
|
||||||
// JSDOM provides a read-only window.location, which does not allow for
|
// JSDOM provides a read-only window.location, which does not allow for
|
||||||
|
|||||||
Reference in New Issue
Block a user