Unverified Commit a1d8927e authored by vercel[bot]'s avatar vercel[bot] Committed by GitHub

Fix rewrite test URL fixture

Co-Authored-By: 's avatarMarcos Hernanz <96699542+marcoshernanz@users.noreply.github.com>
parent f2622b36
import { parseUrl } from '../shared/lib/router/utils/parse-url'
import { getServerUtils } from './server-utils' import { getServerUtils } from './server-utils'
describe('getParamsFromRouteMatches', () => { describe('getParamsFromRouteMatches', () => {
...@@ -89,21 +90,16 @@ describe('handleRewrites', () => { ...@@ -89,21 +90,16 @@ describe('handleRewrites', () => {
pageIsDynamic: false, pageIsDynamic: false,
caseSensitive: false, caseSensitive: false,
}) })
const shared = ['one', 'two'] const parsedUrl = parseUrl('/source?keep=yes&shared=one&shared=two')
const parsedUrl = { const shared = parsedUrl.query.shared
pathname: '/source', const originalUrl = structuredClone(parsedUrl)
query: { keep: 'yes', shared },
}
const { rewrittenParsedUrl } = handleRewrites( const { rewrittenParsedUrl } = handleRewrites(
{} as Parameters<typeof handleRewrites>[0], {} as Parameters<typeof handleRewrites>[0],
parsedUrl parsedUrl
) )
expect(parsedUrl).toEqual({ expect(parsedUrl).toEqual(originalUrl)
pathname: '/source',
query: { keep: 'yes', shared: ['one', 'two'] },
})
expect(parsedUrl.query.shared).toBe(shared) expect(parsedUrl.query.shared).toBe(shared)
expect(rewrittenParsedUrl).toMatchObject({ expect(rewrittenParsedUrl).toMatchObject({
pathname: '/destination', pathname: '/destination',
......
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