🐛(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:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user