diff --git a/fixtures/flight/__tests__/__e2e__/smoke.test.js b/fixtures/flight/__tests__/__e2e__/smoke.test.js index af889d5de16ad..267bd109081a2 100644 --- a/fixtures/flight/__tests__/__e2e__/smoke.test.js +++ b/fixtures/flight/__tests__/__e2e__/smoke.test.js @@ -13,7 +13,9 @@ test('smoke test', async ({page}) => { pageErrors.push(error.stack); }); await page.goto('/'); - await expect(page.locator('h1')).toHaveText('Hello World'); + await expect(page.getByTestId('promise-as-a-child-test')).toHaveText( + 'Promise as a child hydrates without errors: deferred text' + ); await expect(consoleErrors).toEqual([]); await expect(pageErrors).toEqual([]); diff --git a/fixtures/flight/src/App.js b/fixtures/flight/src/App.js index 7a14beb460def..027056c515021 100644 --- a/fixtures/flight/src/App.js +++ b/fixtures/flight/src/App.js @@ -19,6 +19,10 @@ import {like, greet, increment} from './actions.js'; import {getServerState} from './ServerState.js'; +const promisedText = new Promise(resolve => + setTimeout(() => resolve('deferred text'), 100) +); + export default async function App() { const res = await fetch('http://localhost:3001/todos'); const todos = await res.json(); @@ -32,6 +36,11 @@ export default async function App() {

{getServerState()}

+ +
+ Promise as a child hydrates without errors: {promisedText} +
+