mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What? Visiting an edge catch-all route incorrectly truncates multiple parameters ### Why? The params are currently coerced into a `ParsedURLQuery`-like format by calling `Object.fromEntries` on `searchParams`, but this doesn't consider multiple param values assigned to the same key ### How? Rather than use `fromEntries`, this uses an existing util to get the path into `ParsedURLQuery` format. Closes NEXT-1814 Fixes #59333
24 lines
642 B
TypeScript
24 lines
642 B
TypeScript
import { createNextDescribe } from 'e2e-utils'
|
|
|
|
createNextDescribe(
|
|
'edge-route-catchall',
|
|
{
|
|
files: __dirname,
|
|
},
|
|
({ next }) => {
|
|
it('should correctly normalize edge route catch-all with a single param', async () => {
|
|
const result = await next.fetch('/edge/one')
|
|
|
|
expect(await result.text()).toBe(JSON.stringify({ slug: ['one'] }))
|
|
})
|
|
|
|
it('should correctly normalize edge route catch-all with multiple params', async () => {
|
|
const result = await next.fetch('/edge/one/two/three')
|
|
|
|
expect(await result.text()).toBe(
|
|
JSON.stringify({ slug: ['one', 'two', 'three'] })
|
|
)
|
|
})
|
|
}
|
|
)
|