mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
In minimal mode, if there was `/[slug].js` with `notFound: true` on the same segment of `_error.js`, `req.url` and `ctx.asPath` were returned as `/[slug]`, since it was re-initialized to the request url. Therefore, don't re-initialize the URL if it is in minimal mode && is the `_error` page. Fixes NEXT-4660 --------- Co-authored-by: JJ Kasper <[email protected]>
14 lines
409 B
TypeScript
14 lines
409 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('error-handler-not-found-req-url', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should log the correct request url and asPath for not found _error page', async () => {
|
|
const browser = await next.browser('/3')
|
|
const p = await browser.elementByCss('p')
|
|
expect(await p.text()).toBe('reqUrl: /3, asPath: /3')
|
|
})
|
|
})
|