Skip to content

Commit 7d4579b

Browse files
cliftonmcintoshclaude
authored andcommitted
Fix window.location mock incompatibility with Node 24 jsdom
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9ff149a commit 7d4579b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/javascript/__tests__/two_minute_warning_session_timeout.test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ describe('session_timeout_poller', () => {
1313
mockAlert = jest.fn()
1414
mockReload = jest.fn()
1515
global.alert = mockAlert
16-
Object.defineProperty(window, 'location', {
17-
writable: true,
18-
value: { reload: mockReload }
19-
})
16+
delete window.location
17+
window.location = { reload: mockReload }
2018

2119
// Set a short timeout for testing (in minutes)
2220
originalTimeout = global.window.timeout

0 commit comments

Comments
 (0)