From 609f02614021b7822ed2f0bf58a6e15336261086 Mon Sep 17 00:00:00 2001 From: Clifton McIntosh Date: Sun, 5 Apr 2026 08:22:30 -0500 Subject: [PATCH 1/2] Fix window.location mock incompatibility with Node 24 jsdom Co-Authored-By: Claude Sonnet 4.6 --- .../__tests__/two_minute_warning_session_timeout.test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/javascript/__tests__/two_minute_warning_session_timeout.test.js b/app/javascript/__tests__/two_minute_warning_session_timeout.test.js index e70f895235..2c7387ebb7 100644 --- a/app/javascript/__tests__/two_minute_warning_session_timeout.test.js +++ b/app/javascript/__tests__/two_minute_warning_session_timeout.test.js @@ -13,10 +13,8 @@ describe('session_timeout_poller', () => { mockAlert = jest.fn() mockReload = jest.fn() global.alert = mockAlert - Object.defineProperty(window, 'location', { - writable: true, - value: { reload: mockReload } - }) + delete window.location + window.location = { reload: mockReload } // Set a short timeout for testing (in minutes) originalTimeout = global.window.timeout From 1aa0325dbe6988b438925ea0b616fcf5b8a79da9 Mon Sep 17 00:00:00 2001 From: Clifton McIntosh Date: Sun, 5 Apr 2026 08:23:12 -0500 Subject: [PATCH 2/2] Fix CSS color assertion incompatibility with Node 24 jsdom Co-Authored-By: Claude Sonnet 4.6 --- app/javascript/__tests__/validated_form.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/__tests__/validated_form.test.js b/app/javascript/__tests__/validated_form.test.js index c82e667835..3d4a5d0432 100644 --- a/app/javascript/__tests__/validated_form.test.js +++ b/app/javascript/__tests__/validated_form.test.js @@ -146,12 +146,12 @@ describe('NonDrivingContactMediumWarning', () => { $(() => { try { expect(checkboxContainer.css('background-color')).not.toBe('rgb(255, 248, 225)') - expect(milesDrivenInput.css('border')).not.toBe('2px solid #ffc107') + expect(milesDrivenInput.css('border')).not.toBe('2px solid rgb(255, 193, 7)') component.warningHighlightUI('A warning message') expect(checkboxContainer.css('background-color')).toBe('rgb(255, 248, 225)') - expect(milesDrivenInput.css('border')).toBe('2px solid #ffc107') + expect(milesDrivenInput.css('border')).toBe('2px solid rgb(255, 193, 7)') done() } catch (error) { done(error) @@ -163,17 +163,17 @@ describe('NonDrivingContactMediumWarning', () => { $(() => { try { expect(checkboxContainer.css('background-color')).not.toBe('rgb(255, 248, 225)') - expect(milesDrivenInput.css('border')).not.toBe('2px solid #ffc107') + expect(milesDrivenInput.css('border')).not.toBe('2px solid rgb(255, 193, 7)') component.warningHighlightUI('A warning message') expect(checkboxContainer.css('background-color')).toBe('rgb(255, 248, 225)') - expect(milesDrivenInput.css('border')).toBe('2px solid #ffc107') + expect(milesDrivenInput.css('border')).toBe('2px solid rgb(255, 193, 7)') component.warningHighlightUI() expect(checkboxContainer.css('background-color')).not.toBe('rgb(255, 248, 225)') - expect(milesDrivenInput.css('border')).not.toBe('2px solid #ffc107') + expect(milesDrivenInput.css('border')).not.toBe('2px solid rgb(255, 193, 7)') done() } catch (error) {