Skip to content

Commit

Permalink
Fix test in IE
Browse files Browse the repository at this point in the history
  • Loading branch information
maier49 committed Jun 21, 2019
1 parent 95ccdef commit 66e46ba
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/core/unit/registerCustomElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { v, w } from '../../../src/core/vdom';
import register, { create, CustomElementChildType } from '../../../src/core/registerCustomElement';
import { createResolvers } from '../support/util';
import { ThemedMixin, theme } from '../../../src/core/mixins/Themed';
import { waitFor } from './waitFor';

const { describe, it, beforeEach, afterEach, before } = intern.getInterface('bdd');
const { assert } = intern.getPlugin('chai');
Expand Down Expand Up @@ -372,7 +373,7 @@ describe('registerCustomElement', () => {
assert.equal(display, 'block');
});

it('handles children being appended as document is still loading', () => {
it('handles children being appended as document is still loading', async () => {
register(DelayedChildrenWidget);

Object.defineProperty(document, 'readyState', {
Expand All @@ -396,14 +397,10 @@ describe('registerCustomElement', () => {
child = document.createTextNode('bar');
element!.appendChild(child);

return new Promise((resolve) => {
setTimeout(() => {
assert.equal(
element!.outerHTML,
'<delayed-children-element style="display: block;"><div><div data-key="child-0">foo</div><div data-key="child-1">bar</div></div></delayed-children-element>'
);
resolve();
});
});
waitFor(
() =>
element!.outerHTML ===
'<delayed-children-element style="display: block;"><div><div data-key="child-0">foo</div><div data-key="child-1">bar</div></div></delayed-children-element>'
);
});
});

0 comments on commit 66e46ba

Please sign in to comment.