Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1b4bd0

Browse files
author
Philip Roberts
committed
Add failing test for preload bug
1 parent 5785cf3 commit e1b4bd0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,6 @@ suite('include-fragment-element', function() {
485485
const div = document.createElement('div')
486486
div.innerHTML = '<include-fragment loading="lazy" src="/hello">loading</include-fragment>'
487487
document.body.appendChild(div)
488-
489488
return when(div.firstChild, 'include-fragment-replaced').then(() => {
490489
assert.equal(document.querySelector('include-fragment'), null)
491490
assert.equal(document.querySelector('#replaced').textContent, 'hello')
@@ -582,9 +581,11 @@ suite('include-fragment-element', function() {
582581
}, 0)
583582

584583
return load
585-
.then(() => when(div.firstChild, 'loadend'))
584+
.then(() => when(div.firstChild, 'include-fragment-replaced'))
586585
.then(() => {
587586
assert.equal(count, 1, "Load occured too many times")
587+
assert.equal(document.querySelector('include-fragment'), null)
588+
assert.equal(document.querySelector('#replaced').textContent, 'hello')
588589
})
589590
})
590591
})

0 commit comments

Comments
 (0)