feat: backfill file hashes for existing documents (#56) #59
@@ -482,7 +482,7 @@ test.describe('PDF annotations — read-only user', () => {
|
|||||||
// Isolated session — does not share the admin storage state
|
// Isolated session — does not share the admin storage state
|
||||||
test.use({ storageState: { cookies: [], origins: [] } });
|
test.use({ storageState: { cookies: [], origins: [] } });
|
||||||
|
|
||||||
test('read-only user sees a disabled Annotieren button', async ({ page }) => {
|
test('read-only user does not see the Annotieren button', async ({ page }) => {
|
||||||
test.setTimeout(60_000);
|
test.setTimeout(60_000);
|
||||||
await page.goto('/login');
|
await page.goto('/login');
|
||||||
await page.getByLabel('Benutzername').fill('reader');
|
await page.getByLabel('Benutzername').fill('reader');
|
||||||
@@ -494,12 +494,10 @@ test.describe('PDF annotations — read-only user', () => {
|
|||||||
const baseURL = process.env.E2E_BASE_URL ?? 'http://localhost:3000';
|
const baseURL = process.env.E2E_BASE_URL ?? 'http://localhost:3000';
|
||||||
await page.goto(`${baseURL}/documents/${sharedAnnotationDocId}`);
|
await page.goto(`${baseURL}/documents/${sharedAnnotationDocId}`);
|
||||||
await page.waitForSelector('[data-hydrated]');
|
await page.waitForSelector('[data-hydrated]');
|
||||||
// Wait for the PDF canvas — once rendered, the controls bar (with disabled button) is shown.
|
|
||||||
await page.locator('canvas').first().waitFor({ state: 'visible', timeout: 30000 });
|
|
||||||
|
|
||||||
const disabledBtn = page.getByRole('button', { name: /annotieren/i });
|
// Reader users do not have ANNOTATE_ALL permission — the button must not be shown at all.
|
||||||
await expect(disabledBtn).toBeVisible({ timeout: 5000 });
|
const annotateBtn = page.getByRole('button', { name: /annotieren/i });
|
||||||
await expect(disabledBtn).toBeDisabled();
|
await expect(annotateBtn).not.toBeVisible({ timeout: 5000 });
|
||||||
|
|
||||||
await page.screenshot({ path: 'test-results/e2e/annotations-button-reader.png' });
|
await page.screenshot({ path: 'test-results/e2e/annotations-button-reader.png' });
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user