Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix app render: escape segment value #42626

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
#42398 test(production): check link to iso route
  • Loading branch information
Marcus-Rise committed Nov 8, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 6e3d969766c0cb2c539c3606a83d33e32deaf112
22 changes: 18 additions & 4 deletions test/production/app-dir-prefetch-non-iso-url/index.test.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ import { NextInstance } from 'test/lib/next-modes/base'
import { join } from 'path'
import { BrowserInterface } from '../../lib/browsers/base'
import webdriver from 'next-webdriver'
import { waitFor } from 'next-test-utils'

describe('app-dir-prefetch-non-iso-url', () => {
let next: NextInstance
@@ -18,16 +17,31 @@ describe('app-dir-prefetch-non-iso-url', () => {
})
afterAll(() => next.destroy())

it('should go to iso url', async () => {
let browser: BrowserInterface

try {
browser = await webdriver(next.appPort, '/')
await browser.elementByCss('#to-iso').click()

const text = await browser.elementByCss('#page').text()
expect(text).toBe('/[slug]')
} finally {
if (browser) {
await browser.close()
}
}
})

it('should go to non-iso url', async () => {
let browser: BrowserInterface

try {
browser = await webdriver(next.appPort, '/')
await browser.elementByCss('#to-non-iso').click()

await waitFor(3000)

expect(browser.elementByCss('#page')).toBe('/[slug]')
const text = await browser.elementByCss('#page').text()
expect(text).toBe('/[slug]')
} finally {
if (browser) {
await browser.close()