mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
fix racy test
This commit is contained in:
@@ -20,14 +20,16 @@
|
||||
<x-foo id="main"></x-foo>
|
||||
<script>
|
||||
test('upgrade order', function() {
|
||||
var order = [];
|
||||
class XFoo extends HTMLElement {
|
||||
connectedCallback() {
|
||||
order.push(this.id);
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
var order = [];
|
||||
class XFoo extends HTMLElement {
|
||||
connectedCallback() {
|
||||
order.push(this.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
window.customElements.define('x-foo', XFoo);
|
||||
assert.deepEqual(order, ['import', 'main'], 'elements are upgraded in imports before main document');
|
||||
window.customElements.define('x-foo', XFoo);
|
||||
assert.deepEqual(order, ['import', 'main'], 'elements are upgraded in imports before main document');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user