|
1 | 1 | import React from 'react';
|
2 | 2 | import { assert, describe, it } from 'vitest';
|
3 |
| -import { createBridgeComponent, createRemoteComponent } from '../src/v19'; |
| 3 | +import { createBridgeComponent, createRemoteComponent } from '../src'; |
4 | 4 | import {
|
5 | 5 | act,
|
6 | 6 | fireEvent,
|
@@ -66,12 +66,8 @@ describe('bridge', () => {
|
66 | 66 | );
|
67 | 67 | expect(getHtml(container)).toMatch('loading');
|
68 | 68 |
|
69 |
| - await waitFor( |
70 |
| - () => { |
71 |
| - expect(getHtml(container)).toMatch('life cycle render'); |
72 |
| - }, |
73 |
| - { timeout: 1000 }, |
74 |
| - ); |
| 69 | + await sleep(200); |
| 70 | + expect(getHtml(container)).toMatch('life cycle render'); |
75 | 71 | expect(getHtml(container)).toMatch('hello world');
|
76 | 72 | });
|
77 | 73 |
|
@@ -101,12 +97,8 @@ describe('bridge', () => {
|
101 | 97 | );
|
102 | 98 | expect(getHtml(container)).toMatch('loading');
|
103 | 99 |
|
104 |
| - await waitFor( |
105 |
| - () => { |
106 |
| - expect(getHtml(container)).toMatch('life cycle render'); |
107 |
| - }, |
108 |
| - { timeout: 1000 }, |
109 |
| - ); |
| 100 | + await sleep(200); |
| 101 | + expect(getHtml(container)).toMatch('life cycle render'); |
110 | 102 | expect(getHtml(container)).toMatch('hello world');
|
111 | 103 | expect(ref.current).not.toBeNull();
|
112 | 104 | });
|
@@ -139,11 +131,7 @@ describe('bridge', () => {
|
139 | 131 | const { container } = render(<RemoteComponent />);
|
140 | 132 | expect(getHtml(container)).toMatch('loading');
|
141 | 133 |
|
142 |
| - await waitFor( |
143 |
| - () => { |
144 |
| - expect(renderMock).toHaveBeenCalledTimes(1); |
145 |
| - }, |
146 |
| - { timeout: 1000 }, |
147 |
| - ); |
| 134 | + await sleep(200); |
| 135 | + expect(renderMock).toHaveBeenCalledTimes(1); |
148 | 136 | });
|
149 | 137 | });
|
0 commit comments