diff --git a/frontend/e2e/dashboard-classic-split.spec.ts b/frontend/e2e/dashboard-classic-split.spec.ts new file mode 100644 index 00000000..203a67a2 --- /dev/null +++ b/frontend/e2e/dashboard-classic-split.spec.ts @@ -0,0 +1,29 @@ +import { test, expect } from '@playwright/test'; +import { login } from './helpers/auth'; + +/** + * Classic Split layout — verifies the right column visibility guard. + * + * The right column (DropZone + NeedsMetadata queue) is only rendered when + * `canWrite === true` or there are incomplete docs. A read-only user with a + * complete archive must never see an empty 300px ghost column. + */ + +test.describe('Dashboard Classic Split — write user', () => { + test('right column is visible for admin user', async ({ page }) => { + await page.goto('/'); + await expect(page.getByTestId('dashboard-right-column')).toBeVisible(); + }); +}); + +test.describe('Dashboard Classic Split — read-only user', () => { + test.use({ storageState: { cookies: [], origins: [] } }); + + test.beforeEach(async ({ page }) => { + await login(page, 'reader', 'reader123'); + }); + + test('right column is absent for read-only user with no incomplete docs', async ({ page }) => { + await expect(page.getByTestId('dashboard-right-column')).not.toBeVisible(); + }); +});