🩹(frontend) refresh tree after duplicate

After duplicating a document, the tree is now
refreshed to reflect the new structure.
This ensures that the user sees the updated
document tree immediately after the duplication
action.
This commit is contained in:
Anthony LC
2025-07-09 13:53:07 +02:00
parent 8a3dfe0252
commit 52a8dd0b5c
4 changed files with 34 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import {
mockedInvitations,
verifyDocName,
} from './common';
import { createRootSubPage } from './sub-pages-utils';
test.beforeEach(async ({ page }) => {
await page.goto('/');
@@ -456,6 +457,32 @@ test.describe('Doc Header', () => {
await page.getByText(duplicateDuplicateTitle).click();
await expect(page.getByText('Hello Duplicated World')).toBeVisible();
});
test('it duplicates a child document', async ({ page, browserName }) => {
await createDoc(page, `Duplicate doc`, browserName);
const { name: childTitle } = await createRootSubPage(
page,
browserName,
'Duplicate doc - child',
);
const editor = page.locator('.ProseMirror');
await editor.click();
await editor.fill('Hello Duplicated World');
await page.getByLabel('Open the document options').click();
await page.getByRole('menuitem', { name: 'Duplicate' }).click();
await expect(
page.getByText('Document duplicated successfully!'),
).toBeVisible();
const duplicateDuplicateTitle = 'Copy of ' + childTitle;
await expect(
page.getByTestId('doc-tree').getByText(duplicateDuplicateTitle),
).toBeVisible();
});
});
test.describe('Documents Header mobile', () => {