🐛(frontend) scroll back to top when navigate to a document

When navigating to a new document, the scroll
position was preserved. This commit changes this
behavior to scroll back to the top of
the page when navigating to a new document.
This commit is contained in:
Anthony LC
2025-09-18 17:40:47 +02:00
parent a751f1255a
commit c23ff546d8
6 changed files with 115 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ import { Page, expect } from '@playwright/test';
import {
randomName,
updateDocTitle,
verifyDocName,
waitForResponseCreateDoc,
} from './utils-common';
@@ -65,3 +66,15 @@ export const clickOnAddRootSubPage = async (page: Page) => {
await rootItem.hover();
await rootItem.getByRole('button', { name: /add subpage/i }).click();
};
export const navigateToPageFromTree = async ({
page,
title,
}: {
page: Page;
title: string;
}) => {
const docTree = page.getByTestId('doc-tree');
await docTree.getByText(title).click();
await verifyDocName(page, title);
};