rsnext/test/e2e/app-dir/parallel-routes-and-interception-basepath/parallel-routes-and-interception-basepath.test.ts
Alexander Savelyev ac325dfd0b
Fix intercepted segments with basepath (#60485)
### Fixing a bug

### What?
When basePath is added, intercepted routes stop working correctly.

### Why?

For them, basePath was not added at all.

### How?

Added basePath to the rewrites for intercepted routes.

Fixes #52624, #58268
2024-01-10 13:18:00 -08:00

25 lines
929 B
TypeScript

import { createNextDescribe } from 'e2e-utils'
createNextDescribe(
'parallel-routes-and-interception-basepath',
{
files: __dirname,
},
({ next }) => {
it('should show parallel intercepted slot with basepath', async () => {
const browser = await next.browser('/base')
await browser.elementByCss('#link-to-nested').click()
const homePage = await browser.elementByCss('#home-page').text()
const slot = await browser.elementByCss('#nested-page-slot').text()
expect(homePage).toBe('Home page')
expect(slot).toBe('Nested Page Slot')
})
it('should show normal route via direct link with basepath when parallel intercepted slot exist', async () => {
const browser = await next.browser('/base/nested')
const nestedPageFull = await browser
.elementByCss('#nested-page-full')
.text()
expect(nestedPageFull).toBe('Nested Page Full')
})
}
)