From ba9f07e60acf11b1d9b4b13b7f9a783319122c0a Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Wed, 2 Mar 2022 19:26:25 +0100 Subject: [PATCH] remove invalid test --- .../react-18/app/pages/suspense/unwrapped.js | 19 ------------------- test/integration/react-18/test/index.test.js | 15 --------------- 2 files changed, 34 deletions(-) delete mode 100644 test/integration/react-18/app/pages/suspense/unwrapped.js diff --git a/test/integration/react-18/app/pages/suspense/unwrapped.js b/test/integration/react-18/app/pages/suspense/unwrapped.js deleted file mode 100644 index 93c32bbbc501..000000000000 --- a/test/integration/react-18/app/pages/suspense/unwrapped.js +++ /dev/null @@ -1,19 +0,0 @@ -import React, { Suspense } from 'react' -import dynamic from 'next/dynamic' - -// flag for testing -const wrapped = true - -const Hello = dynamic(() => import('../../components/hello'), { - suspense: true, -}) - -export default function Unwrapped() { - if (!wrapped) return - - return ( - - - - ) -} diff --git a/test/integration/react-18/test/index.test.js b/test/integration/react-18/test/index.test.js index 2660a9fd20b1..ab362789579f 100644 --- a/test/integration/react-18/test/index.test.js +++ b/test/integration/react-18/test/index.test.js @@ -25,7 +25,6 @@ const nodeArgs = ['-r', join(__dirname, 'require-hook.js')] const appDir = join(__dirname, '../app') const nextConfig = new File(join(appDir, 'next.config.js')) const dynamicHello = new File(join(appDir, 'components/dynamic-hello.js')) -const unwrappedPage = new File(join(appDir, 'pages/suspense/unwrapped.js')) const invalidPage = new File(join(appDir, 'pages/invalid.js')) const USING_CREATE_ROOT = 'Using the createRoot API for React' @@ -95,20 +94,6 @@ describe('React 18 Support', () => { describe('Basics', () => { runTests('default setting with react 18', (context) => basics(context)) - - it('suspense is not allowed in blocking rendering mode (dev)', async () => { - // set dynamic.suspense = true but not wrapping with - unwrappedPage.replace('wrapped = true', 'wrapped = false') - const appPort = await findPort() - const app = await launchApp(appDir, appPort, { nodeArgs }) - const html = await renderViaHTTP(appPort, '/suspense/unwrapped') - unwrappedPage.restore() - await killApp(app) - - expect(html).toContain( - 'A React component suspended while rendering, but no fallback UI was specified' - ) - }) }) // React 18 with Strict Mode enabled might cause double invocation of lifecycle methods.