diff --git a/tests/cases/applyReactInVue/1-test.js b/tests/cases/applyReactInVue/1-test.js
index d0453a9..3b5edc1 100644
--- a/tests/cases/applyReactInVue/1-test.js
+++ b/tests/cases/applyReactInVue/1-test.js
@@ -5,20 +5,16 @@ import LazyReactInVue from './LazyReactInVue'
// function Basic() {
// return h('div', null, 121212)
// }
-test('renders a React component In Vue', (done) => {
+test('renders a React component In Vue', async () => {
render(Basic);
- setTimeout(() => {
- const linkElement = screen.getByText(/React in Vue/);
- expect(linkElement).toBeInTheDocument();
- done()
- })
+ const linkElement = await screen.findByText(/React in Vue/);
+ expect(linkElement).toBeInTheDocument();
});
-test('test lazyReactInVue', (done) => {
+test('test lazyReactInVue', async () => {
render(LazyReactInVue);
- setTimeout(() => {
- const linkElement = screen.getByText(/test lazyReactInVue/);
- expect(linkElement).toBeInTheDocument();
- done()
- })
+ let linkElement = await screen.findByText(/test lazyReactInVue/);
+ expect(linkElement).toBeInTheDocument();
+ linkElement = await screen.findByText(/test lazyPureReactInVue/);
+ expect(linkElement).toBeInTheDocument();
})
diff --git a/tests/cases/applyReactInVue/2-scopedSlots-vnode-test.js b/tests/cases/applyReactInVue/2-scopedSlots-vnode-test.js
index f741b29..fbaf5e6 100644
--- a/tests/cases/applyReactInVue/2-scopedSlots-vnode-test.js
+++ b/tests/cases/applyReactInVue/2-scopedSlots-vnode-test.js
@@ -3,15 +3,12 @@ import React from 'react';
import { render, screen } from '@testing-library/vue';
import Event from "./2-scopedSlot-vnode"
-test('test scoped slots', (done) => {
+test('test scoped slots', async () => {
render(Event);
- setTimeout(() => {
- const linkElement = screen.getByText(/vnode-/);
- expect(linkElement).toBeInTheDocument()
- const linkElement1 = screen.getByText(/scopedSlotA-attr1/);
- expect(linkElement1).toBeInTheDocument()
- const linkElement2 = screen.getByText(/slotA/);
- expect(linkElement2).toBeInTheDocument()
- done()
- });
+ const linkElement = await screen.findByText(/vnode-/);
+ expect(linkElement).toBeInTheDocument()
+ const linkElement1 = await screen.findByText(/scopedSlotA-attr1/);
+ expect(linkElement1).toBeInTheDocument()
+ const linkElement2 = await screen.findByText(/slotA/);
+ expect(linkElement2).toBeInTheDocument()
});
diff --git a/tests/cases/applyReactInVue/3-getReactNode-test.js b/tests/cases/applyReactInVue/3-getReactNode-test.js
index 36a5603..9f55eb3 100644
--- a/tests/cases/applyReactInVue/3-getReactNode-test.js
+++ b/tests/cases/applyReactInVue/3-getReactNode-test.js
@@ -2,12 +2,8 @@ import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/vue';
import VueComponent from './3-getReactNode';
-test('test getReactNode', (done) => {
+test('test getReactNode', async () => {
render(VueComponent);
- setTimeout(() => {
- const linkElement = screen.getByText(/test getReactNode/);
- expect(linkElement).toBeInTheDocument();
- done()
- })
-
+ const linkElement = await screen.findByText(/test getReactNode/);
+ expect(linkElement).toBeInTheDocument();
});
diff --git a/tests/cases/applyReactInVue/LazyReactInVue.vue b/tests/cases/applyReactInVue/LazyReactInVue.vue
index 03366f4..1d87fb1 100644
--- a/tests/cases/applyReactInVue/LazyReactInVue.vue
+++ b/tests/cases/applyReactInVue/LazyReactInVue.vue
@@ -1,10 +1,17 @@
-