mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-09 10:54:11 -04:00
Updated tests to mock new immutable window location object
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
// Polyfills for any parts of the DOM API available in browsers but not JSDOM
|
||||
|
||||
let _location = {
|
||||
reload: jest.fn(),
|
||||
hostname: "beta.notify.gov",
|
||||
assign: jest.fn(),
|
||||
href: "https://beta.notify.gov",
|
||||
}
|
||||
|
||||
// JSDOM provides a read-only window.location, which does not allow for
|
||||
// mocking or setting.
|
||||
Object.defineProperty(window, 'location', {
|
||||
get: () => _location,
|
||||
set: (value) => {
|
||||
_location = value
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user