Unverified Commit 8f67469b authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

fix parallel-route-not-found-params deploy test (#66807)

The rest of this test is valid for a deployed environment, we just won't
have access to runtime logs.
parent e2968464
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
"test/e2e/react-dnd-compile/react-dnd-compile.test.ts", "test/e2e/react-dnd-compile/react-dnd-compile.test.ts",
"test/e2e/skip-trailing-slash-redirect/index.test.ts", "test/e2e/skip-trailing-slash-redirect/index.test.ts",
"test/e2e/app-dir/app-compilation/index.test.ts", "test/e2e/app-dir/app-compilation/index.test.ts",
"test/e2e/app-dir/parallel-route-not-found-params/parallel-route-not-found-params.test.ts",
"test/e2e/app-dir/ppr/ppr.test.ts", "test/e2e/app-dir/ppr/ppr.test.ts",
"test/e2e/app-dir/rsc-webpack-loader/rsc-webpack-loader.test.ts", "test/e2e/app-dir/rsc-webpack-loader/rsc-webpack-loader.test.ts",
"test/e2e/swc-warnings/index.test.ts", "test/e2e/swc-warnings/index.test.ts",
......
...@@ -2,22 +2,26 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -2,22 +2,26 @@ import { nextTestSetup } from 'e2e-utils'
import { check } from 'next-test-utils' import { check } from 'next-test-utils'
describe('parallel-route-not-found', () => { describe('parallel-route-not-found', () => {
const { next } = nextTestSetup({ const { next, isNextDeploy } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
it('should behave correctly without any errors', async () => { it('should behave correctly without any errors', async () => {
const browser = await next.browser('/en') const browser = await next.browser('/en')
await check(() => {
if (
next.cliOutput.includes('TypeError') ||
next.cliOutput.includes('Warning')
) {
return 'has-errors'
}
return 'success' // Deploy doesn't have access to runtime logs
}, 'success') if (!isNextDeploy) {
await check(() => {
if (
next.cliOutput.includes('TypeError') ||
next.cliOutput.includes('Warning')
) {
return 'has-errors'
}
return 'success'
}, 'success')
}
expect(await browser.elementByCss('body').text()).not.toContain( expect(await browser.elementByCss('body').text()).not.toContain(
'Interception Modal' 'Interception Modal'
...@@ -26,16 +30,19 @@ describe('parallel-route-not-found', () => { ...@@ -26,16 +30,19 @@ describe('parallel-route-not-found', () => {
await browser.elementByCss("[href='/en/show']").click() await browser.elementByCss("[href='/en/show']").click()
await check(() => { // Deploy doesn't have access to runtime logs
if ( if (!isNextDeploy) {
next.cliOutput.includes('TypeError') || await check(() => {
next.cliOutput.includes('Warning') if (
) { next.cliOutput.includes('TypeError') ||
return 'has-errors' next.cliOutput.includes('Warning')
} ) {
return 'has-errors'
}
return 'success' return 'success'
}, 'success') }, 'success')
}
await check(() => browser.elementByCss('body').text(), /Interception Modal/) await check(() => browser.elementByCss('body').text(), /Interception Modal/)
await check(() => browser.elementByCss('body').text(), /Locale: en/) await check(() => browser.elementByCss('body').text(), /Locale: en/)
...@@ -47,16 +54,20 @@ describe('parallel-route-not-found', () => { ...@@ -47,16 +54,20 @@ describe('parallel-route-not-found', () => {
it('should handle the not found case correctly without any errors', async () => { it('should handle the not found case correctly without any errors', async () => {
const browser = await next.browser('/de/show') const browser = await next.browser('/de/show')
await check(() => {
if (
next.cliOutput.includes('TypeError') ||
next.cliOutput.includes('Warning')
) {
return 'has-errors'
}
return 'success' // Deploy doesn't have access to runtime logs
}, 'success') if (!isNextDeploy) {
await check(() => {
if (
next.cliOutput.includes('TypeError') ||
next.cliOutput.includes('Warning')
) {
return 'has-errors'
}
return 'success'
}, 'success')
}
expect(await browser.elementByCss('body').text()).toContain( expect(await browser.elementByCss('body').text()).toContain(
'Custom Not Found' 'Custom Not Found'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment