Fix non chrome view transtions tests (#3338)

fix non chrome view transitions tests
This commit is contained in:
MichaelWest22 2025-06-20 09:02:11 +12:00 committed by GitHub
parent 3f49db3936
commit 84306ccf3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 25 deletions

View File

@ -311,6 +311,7 @@ describe('hx-swap attribute', function() {
done()
})
if (/chrome/i.test(navigator.userAgent)) {
it('works with transition:true', function(done) {
this.server.respondWith('GET', '/test', 'Clicked!')
var div = make(
@ -322,9 +323,9 @@ describe('hx-swap attribute', function() {
setTimeout(function() {
div.innerText.should.equal('Clicked!')
done()
}, 30)
}, 50)
})
}
it('works with a settle delay', function(done) {
this.server.respondWith('GET', '/test', "<div id='d1' class='foo' hx-get='/test' hx-swap='outerHTML settle:10ms'></div>")
var div = make("<div id='d1' hx-get='/test' hx-swap='outerHTML settle:10ms'></div>")

View File

@ -494,6 +494,7 @@ describe('Core htmx API test', function() {
}, 30)
})
if (/chrome/i.test(navigator.userAgent)) {
it('swap works with a view transition', function(done) {
var div = make("<div hx-get='/test'></div>")
div.innerText.should.equal('')
@ -502,9 +503,9 @@ describe('Core htmx API test', function() {
setTimeout(function() {
div.innerText.should.equal('jsswapped')
done()
}, 30)
}, 50)
})
}
it('swaps content properly (with select)', function() {
var output = make('<output id="output"/>')
htmx.swap('#output', '<div><p id="select-me">Swapped!</p></div>', { swapStyle: 'innerHTML' }, { select: '#select-me' })