Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions app/javascript/__tests__/validated_form.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand Down
Loading