|
1 | 1 | import { expect, test } from '@playwright/test' |
2 | 2 | import { setupInlineFixture, type Fixture, useFixture } from './fixture' |
3 | 3 | import { |
4 | | - expectNoPageError, |
5 | 4 | expectNoReload, |
6 | 5 | testNoJs, |
7 | 6 | waitForHydration as waitForHydration_, |
@@ -204,64 +203,6 @@ test.describe(() => { |
204 | 203 | }) |
205 | 204 | }) |
206 | 205 |
|
207 | | -test.describe(() => { |
208 | | - const root = 'examples/e2e/temp/ssr-thenable' |
209 | | - |
210 | | - test.beforeAll(async () => { |
211 | | - await setupInlineFixture({ |
212 | | - src: 'examples/starter', |
213 | | - dest: root, |
214 | | - files: { |
215 | | - 'src/root.tsx': /* tsx */ ` |
216 | | - import { TestClientUse } from './client.tsx' |
217 | | -
|
218 | | - export function Root() { |
219 | | - return ( |
220 | | - <html lang="en"> |
221 | | - <head> |
222 | | - <meta charSet="UTF-8" /> |
223 | | - </head> |
224 | | - <body> |
225 | | - <TestClientUse /> |
226 | | - </body> |
227 | | - </html> |
228 | | - ) |
229 | | - } |
230 | | - `, |
231 | | - 'src/client.tsx': /* tsx */ ` |
232 | | - "use client"; |
233 | | - import React from 'react' |
234 | | -
|
235 | | - const promise = Promise.resolve('ok') |
236 | | -
|
237 | | - export function TestClientUse() { |
238 | | - const value = React.use(promise) |
239 | | - return <span data-testid="client-use">{value}</span> |
240 | | - } |
241 | | - `, |
242 | | - }, |
243 | | - }) |
244 | | - }) |
245 | | - |
246 | | - function defineSsrThenableTest(f: Fixture) { |
247 | | - test('ssr-thenable', async ({ page }) => { |
248 | | - using _ = expectNoPageError(page) |
249 | | - await page.goto(f.url()) |
250 | | - await waitForHydration_(page) |
251 | | - }) |
252 | | - } |
253 | | - |
254 | | - test.describe('dev', () => { |
255 | | - const f = useFixture({ root, mode: 'dev' }) |
256 | | - defineSsrThenableTest(f) |
257 | | - }) |
258 | | - |
259 | | - test.describe('build', () => { |
260 | | - const f = useFixture({ root, mode: 'build' }) |
261 | | - defineSsrThenableTest(f) |
262 | | - }) |
263 | | -}) |
264 | | - |
265 | 206 | function defineTest(f: Fixture, variant?: 'no-ssr') { |
266 | 207 | const waitForHydration: typeof waitForHydration_ = (page) => |
267 | 208 | waitForHydration_(page, variant === 'no-ssr' ? '#root' : 'body') |
|
0 commit comments