fix(next): active nav item not clickable in edit view (#11457)
This fixes an issue where the active collection nav item was non-clickable inside documents. Now, it remains clickable when viewing a document, allowing users to return to the list view from the nav items in the sidebar. The active state indicator still appears in both cases.
This commit is contained in:
@@ -409,12 +409,21 @@ describe('General', () => {
|
||||
test('should disable active nav item', async () => {
|
||||
await page.goto(postsUrl.list)
|
||||
await openNav(page)
|
||||
const activeItem = page.locator('.nav .nav__link.active')
|
||||
const activeItem = page.locator('.nav .nav__link:has(.nav__link-indicator)')
|
||||
await expect(activeItem).toBeVisible()
|
||||
const tagName = await activeItem.evaluate((el) => el.tagName.toLowerCase())
|
||||
expect(tagName).toBe('div')
|
||||
})
|
||||
|
||||
test('should keep active nav item enabled in the edit view', async () => {
|
||||
await page.goto(postsUrl.create)
|
||||
await openNav(page)
|
||||
const activeItem = page.locator('.nav .nav__link:has(.nav__link-indicator)')
|
||||
await expect(activeItem).toBeVisible()
|
||||
const tagName = await activeItem.evaluate((el) => el.tagName.toLowerCase())
|
||||
expect(tagName).toBe('a')
|
||||
})
|
||||
|
||||
test('breadcrumbs — should navigate from list to dashboard', async () => {
|
||||
await page.goto(postsUrl.list)
|
||||
await page.locator(`.step-nav a[href="${adminRoutes.routes.admin}"]`).click()
|
||||
|
||||
@@ -64,7 +64,6 @@ export interface Config {
|
||||
auth: {
|
||||
users: UserAuthOperations;
|
||||
};
|
||||
blocks: {};
|
||||
collections: {
|
||||
uploads: Upload;
|
||||
posts: Post;
|
||||
|
||||
Reference in New Issue
Block a user