Skip to content

Commit

Permalink
fix parallel-route-not-found-params deploy test (vercel#66807)
Browse files Browse the repository at this point in the history
The rest of this test is valid for a deployed environment, we just won't
have access to runtime logs.
  • Loading branch information
ztanner authored Jun 12, 2024
1 parent e296846 commit 8f67469
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 29 deletions.
1 change: 0 additions & 1 deletion test/deploy-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"test/e2e/react-dnd-compile/react-dnd-compile.test.ts",
"test/e2e/skip-trailing-slash-redirect/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/rsc-webpack-loader/rsc-webpack-loader.test.ts",
"test/e2e/swc-warnings/index.test.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@ import { nextTestSetup } from 'e2e-utils'
import { check } from 'next-test-utils'

describe('parallel-route-not-found', () => {
const { next } = nextTestSetup({
const { next, isNextDeploy } = nextTestSetup({
files: __dirname,
})

it('should behave correctly without any errors', async () => {
const browser = await next.browser('/en')
await check(() => {
if (
next.cliOutput.includes('TypeError') ||
next.cliOutput.includes('Warning')
) {
return 'has-errors'
}

return 'success'
}, 'success')
// Deploy doesn't have access to runtime logs
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(
'Interception Modal'
Expand All @@ -26,16 +30,19 @@ describe('parallel-route-not-found', () => {

await browser.elementByCss("[href='/en/show']").click()

await check(() => {
if (
next.cliOutput.includes('TypeError') ||
next.cliOutput.includes('Warning')
) {
return 'has-errors'
}
// Deploy doesn't have access to runtime logs
if (!isNextDeploy) {
await check(() => {
if (
next.cliOutput.includes('TypeError') ||
next.cliOutput.includes('Warning')
) {
return 'has-errors'
}

return 'success'
}, 'success')
return 'success'
}, 'success')
}

await check(() => browser.elementByCss('body').text(), /Interception Modal/)
await check(() => browser.elementByCss('body').text(), /Locale: en/)
Expand All @@ -47,16 +54,20 @@ describe('parallel-route-not-found', () => {

it('should handle the not found case correctly without any errors', async () => {
const browser = await next.browser('/de/show')
await check(() => {
if (
next.cliOutput.includes('TypeError') ||
next.cliOutput.includes('Warning')
) {
return 'has-errors'
}

return 'success'
}, 'success')
// Deploy doesn't have access to runtime logs
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(
'Custom Not Found'
Expand Down

0 comments on commit 8f67469

Please sign in to comment.