From 595c2eb9874af45d775ee48814714e7a2389c293 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 31 Mar 2026 20:27:39 +0200 Subject: [PATCH] =?UTF-8?q?test(e2e):=20Classic=20Split=20=E2=80=94=20righ?= =?UTF-8?q?t=20column=20absent=20for=20read-only=20user,=20present=20for?= =?UTF-8?q?=20admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- frontend/e2e/dashboard-classic-split.spec.ts | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 frontend/e2e/dashboard-classic-split.spec.ts 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(); + }); +});