mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
(generated by graphite) ### What? Introduce `get_specificity` method to determine the specificity of routes. This facilitates more accurate route matching for catchall routes by comparing route specificity. Modify existing route matching logic to incorporate specificity checks and avoid route conflicts. Add corresponding tests to validate the new specificity handling mechanism. Fixes #67045 Closes PACK-3154
20 lines
556 B
TypeScript
20 lines
556 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('catchall-specificity', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should match the generic catchall correctly', async () => {
|
|
const browser = await next.browser('/foo')
|
|
|
|
expect(await browser.elementByCss('body').text()).toContain('Generic Page')
|
|
})
|
|
|
|
it('should match the specific catchall correctly', async () => {
|
|
const browser = await next.browser('/specific')
|
|
|
|
expect(await browser.elementByCss('body').text()).toContain('Specific Page')
|
|
})
|
|
})
|