Skip to content

Commit

Permalink
refactor: sue whenDefined
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 11, 2022
1 parent 81ad428 commit 7961526
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/runtime-dom/__tests__/customElement.spec.ts
Expand Up @@ -292,9 +292,7 @@ describe('defineCustomElement', () => {
const spy = jest.fn()
e.addEventListener('my-click', spy)
// this feels brittle but seems necessary to reach the node in the DOM.
await nextTick()
await nextTick()
await nextTick()
await customElements.whenDefined('my-async-el-emits')
e.shadowRoot!.childNodes[0].dispatchEvent(new CustomEvent('click'))
expect(spy).toHaveBeenCalled()
expect(spy.mock.calls[0][0]).toMatchObject({
Expand Down

0 comments on commit 7961526

Please sign in to comment.