test(e2e): Classic Split — right column absent for read-only user, present for admin
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
29
frontend/e2e/dashboard-classic-split.spec.ts
Normal file
29
frontend/e2e/dashboard-classic-split.spec.ts
Normal file
@@ -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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user