Skip to content

Commit c93aad3

Browse files
committed
fix tests
1 parent 078a60d commit c93aad3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react-dom/src/__tests__/ReactDOMFloat-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,7 +2388,7 @@ body {
23882388
);
23892389

23902390
ReactDOMClient.hydrateRoot(document, <App />);
2391-
expect(Scheduler).toFlushWithoutYielding();
2391+
await waitForAll([]);
23922392

23932393
expect(getMeaningfulChildren(document)).toEqual(
23942394
<html>
@@ -2441,8 +2441,8 @@ body {
24412441
<script itemProp="foo" />
24422442
</html>,
24432443
);
2444-
expect(() => {
2445-
expect(Scheduler).toFlushWithoutYielding();
2444+
await expect(async () => {
2445+
await waitForAll([]);
24462446
}).toErrorDev([
24472447
'Cannot render a <meta> outside the main document if it has an `itemProp` prop. `itemProp` suggests the tag belongs to an `itemScope` which can appear anywhere in the DOM. If you were intending for React to hoist this <meta> remove the `itemProp` prop. Otherwise, try moving this tag into the <head> or <body> of the Document.',
24482448
'Cannot render a <title> outside the main document if it has an `itemProp` prop. `itemProp` suggests the tag belongs to an `itemScope` which can appear anywhere in the DOM. If you were intending for React to hoist this <title> remove the `itemProp` prop. Otherwise, try moving this tag into the <head> or <body> of the Document.',
@@ -2567,7 +2567,7 @@ body {
25672567
// script insertion that happens because we do not SSR async scripts with load handlers.
25682568
// All the extra inject nodes are preset
25692569
const root = ReactDOMClient.hydrateRoot(document, <App />);
2570-
expect(Scheduler).toFlushWithoutYielding();
2570+
await waitForAll([]);
25712571
expect(getMeaningfulChildren(document)).toEqual(
25722572
<html itemscope="">
25732573
<head>

0 commit comments

Comments
 (0)