mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-27 04:50:43 +00:00
Fix non chrome view transtions tests (#3338)
fix non chrome view transitions tests
This commit is contained in:
parent
3f49db3936
commit
84306ccf3d
@ -311,20 +311,21 @@ describe('hx-swap attribute', function() {
|
||||
done()
|
||||
})
|
||||
|
||||
it('works with transition:true', function(done) {
|
||||
this.server.respondWith('GET', '/test', 'Clicked!')
|
||||
var div = make(
|
||||
"<div hx-get='/test' hx-swap='innerHTML transition:true'></div>"
|
||||
)
|
||||
div.click()
|
||||
this.server.respond()
|
||||
div.innerText.should.equal('')
|
||||
setTimeout(function() {
|
||||
div.innerText.should.equal('Clicked!')
|
||||
done()
|
||||
}, 30)
|
||||
})
|
||||
|
||||
if (/chrome/i.test(navigator.userAgent)) {
|
||||
it('works with transition:true', function(done) {
|
||||
this.server.respondWith('GET', '/test', 'Clicked!')
|
||||
var div = make(
|
||||
"<div hx-get='/test' hx-swap='innerHTML transition:true'></div>"
|
||||
)
|
||||
div.click()
|
||||
this.server.respond()
|
||||
div.innerText.should.equal('')
|
||||
setTimeout(function() {
|
||||
div.innerText.should.equal('Clicked!')
|
||||
done()
|
||||
}, 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>")
|
||||
|
@ -494,17 +494,18 @@ describe('Core htmx API test', function() {
|
||||
}, 30)
|
||||
})
|
||||
|
||||
it('swap works with a view transition', function(done) {
|
||||
var div = make("<div hx-get='/test'></div>")
|
||||
div.innerText.should.equal('')
|
||||
htmx.swap(div, 'jsswapped', { transition: true })
|
||||
div.innerText.should.equal('')
|
||||
setTimeout(function() {
|
||||
div.innerText.should.equal('jsswapped')
|
||||
done()
|
||||
}, 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('')
|
||||
htmx.swap(div, 'jsswapped', { transition: true })
|
||||
div.innerText.should.equal('')
|
||||
setTimeout(function() {
|
||||
div.innerText.should.equal('jsswapped')
|
||||
done()
|
||||
}, 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' })
|
||||
|
Loading…
x
Reference in New Issue
Block a user