Skip to content

Commit

Permalink
Fix focusin-based tests (bigskysoftware#2861)
Browse files Browse the repository at this point in the history
  • Loading branch information
Telroshan authored Sep 1, 2024
1 parent 324ee19 commit 326ff3b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/core/parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ describe('Core htmx Parameter Handling', function() {
vals.do.should.equal('rey')
vals.btn.should.equal('bar')
done()
})
}, { once: true })
button.focus()
// Headless / Hardly-throttled CPU might result in 'focusin' not being fired, double it just in case
htmx.trigger(button, 'focusin')
})

it('form includes last focused submit', function(done) {
Expand All @@ -149,8 +151,10 @@ describe('Core htmx Parameter Handling', function() {
vals.do.should.equal('rey')
vals.s1.should.equal('bar')
done()
})
}, { once: true })
button.focus()
// Headless / Hardly-throttled CPU might result in 'focusin' not being fired, double it just in case
htmx.trigger(button, 'focusin')
})

it('form does not include button when focus is lost', function() {
Expand Down

0 comments on commit 326ff3b

Please sign in to comment.