(frontend) add duplicate action to doc tree

We added a duplicate action to the document tree.
This commit is contained in:
Anthony LC
2025-07-15 13:14:41 +02:00
parent 966e514c5a
commit 83f2b3886e
3 changed files with 35 additions and 8 deletions

View File

@@ -471,14 +471,19 @@ test.describe('Doc Header', () => {
await editor.click();
await editor.fill('Hello Duplicated World');
await page.getByLabel('Open the document options').click();
const duplicateTitle = 'Copy of ' + childTitle;
const docTree = page.getByTestId('doc-tree');
const child = docTree
.getByRole('treeitem')
.locator('.--docs-sub-page-item')
.filter({
hasText: childTitle,
});
await child.hover();
await child.getByText(`more_horiz`).click();
await page.getByRole('menuitem', { name: 'Duplicate' }).click();
await expect(
page.getByText('Document duplicated successfully!'),
).toBeVisible();
const duplicateTitle = 'Copy of ' + childTitle;
await verifyDocName(page, duplicateTitle);