Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 845dbad

Browse files
committed
test: updated tests
1 parent 88df0d5 commit 845dbad

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/c-portal/tests/portal.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { nextTick, ref } from 'vue'
2-
import { render, screen } from '../../test-utils/src'
2+
import { render, screen, waitMs } from '../../test-utils/src'
33
import { CPortal } from '../src'
44

55
const renderComponent = (props?: any) => {
@@ -28,13 +28,15 @@ afterEach(() => {
2828
document.getElementById(`chakra__portal__${PORTAL_RENDER_COUNT}`)
2929
})
3030

31-
it('should not render anything if no children exist', () => {
31+
it('should not render anything if no children exist', async () => {
3232
const { asFragment } = renderComponent()
33+
await waitMs(300)
3334
expect(asFragment()).toMatchSnapshot()
3435
})
3536

36-
it('should create default target for default children', () => {
37+
it('should create default target for default children', async () => {
3738
renderComponent()
39+
await waitMs(300)
3840
expect(document.body).toContainElement(PORTAL_TARGET_ELEMENT())
3941
expect(document.body.innerHTML).toMatchSnapshot()
4042
})

0 commit comments

Comments
 (0)