test(e2e): smoke — create folder + breadcrumb update on documents hub

Covers the happy-path admin flow: open hub, open Folder Actions menu,
create a root folder, click into it, breadcrumb updates. Doesn't yet
cover delete (soft-rescue) or move-to-folder — separate spec when
needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 12:36:59 +02:00
parent 8e06d4549d
commit 92759d03e8

View File

@@ -57,4 +57,23 @@ test.describe('Document Management', () => {
await tab.click();
await expect(tab).toHaveAttribute('data-state', 'active');
});
test('admin can create a folder and the breadcrumb updates', async ({ page }) => {
await navigateTo(page, '/documents');
await page.waitForLoadState('networkidle');
// Create a folder via the actions menu.
await page.getByRole('button', { name: /folder actions/i }).click();
await page.getByRole('menuitem', { name: /new folder at root/i }).click();
const folderName = `Smoke ${Date.now()}`;
await page.getByLabel('Name').fill(folderName);
await page.getByRole('button', { name: 'Create' }).click();
// The new folder should appear in the FolderTreeSidebar as a button
// whose accessible name matches its text content (node.name span).
await expect(page.getByRole('button', { name: folderName })).toBeVisible({ timeout: 10_000 });
// Click into the folder; breadcrumb should update to show the folder name.
await page.getByRole('button', { name: folderName }).click();
await expect(page.getByRole('navigation', { name: /breadcrumb/i })).toContainText(folderName);
});
});