mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
29 lines
922 B
TypeScript
29 lines
922 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('conflicting-search-and-route-params', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should handle conflicting search and route params on page', async () => {
|
|
const browser = await next.browser('/render/123?id=456')
|
|
|
|
const routeParamText = await browser.elementByCss('#route-param').text()
|
|
expect(routeParamText).toContain('Route param id: 123')
|
|
|
|
const searchParamText = await browser.elementByCss('#search-param').text()
|
|
expect(searchParamText).toContain('Search param id: 456')
|
|
})
|
|
|
|
it('should handle conflicting search and route params on API route', async () => {
|
|
// Test with route param "789" and search param "abc"
|
|
const response = await next.fetch('/api/789?id=abc')
|
|
const data = await response.json()
|
|
|
|
expect(data).toEqual({
|
|
routeParam: '789',
|
|
searchParam: 'abc',
|
|
})
|
|
})
|
|
})
|