From 3b41b85c5de0f23b205c765a485a4f8d8266083b Mon Sep 17 00:00:00 2001
From: Hendrik Liebau
Date: Thu, 28 Mar 2024 09:17:20 +0100
Subject: [PATCH] Enhance test to show that b835af277 is not a solution
---
.../src/__tests__/ReactFlightDOM-test.js | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js
index d1a065ec509dc..b792844a0b49f 100644
--- a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js
+++ b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js
@@ -864,6 +864,7 @@ describe('ReactFlightDOM', () => {
}
const [Posts, resolvePostsData] = makeDelayedText();
+ const [Photos, resolvePhotosData] = makeDelayedText();
const suspendedChunk = createSuspendedChunk(loading
);
const {writable, readable} = getTestStream();
const {pipe} = ReactServerDOMServer.renderToPipeableStream(
@@ -893,8 +894,9 @@ describe('ReactFlightDOM', () => {
const donePromise = createResolvablePromise();
const value = (
- loading posts
}>
+ loading posts and photos}>
+
);
@@ -903,13 +905,14 @@ describe('ReactFlightDOM', () => {
donePromise.resolve({value, done: true});
});
- expect(container.innerHTML).toBe('loading posts
');
+ expect(container.innerHTML).toBe('loading posts and photos
');
await act(async () => {
await resolvePostsData('posts');
+ await resolvePhotosData('photos');
});
- expect(container.innerHTML).toBe('posts
');
+ expect(container.innerHTML).toBe('posts
photos
');
expect(reportedErrors).toEqual([]);
});