feat: page-by-page streaming OCR with real-time progress #88
@@ -327,10 +327,12 @@ test.describe('PDF annotations — admin', () => {
|
|||||||
await page.waitForSelector('[data-hydrated]');
|
await page.waitForSelector('[data-hydrated]');
|
||||||
await page.locator('canvas').first().waitFor({ state: 'visible', timeout: 20000 });
|
await page.locator('canvas').first().waitFor({ state: 'visible', timeout: 20000 });
|
||||||
|
|
||||||
// Ensure annotation is visible before enabling annotate mode
|
// Ensure at least one annotation is visible before enabling annotate mode
|
||||||
await expect(page.locator('[data-testid^="annotation-"]').first()).toBeVisible({
|
await expect(page.locator('[data-testid^="annotation-"]').first()).toBeVisible({
|
||||||
timeout: 8000
|
timeout: 8000
|
||||||
});
|
});
|
||||||
|
// Record count now — the draw test may have created more than one annotation
|
||||||
|
const countBefore = await page.locator('[data-testid^="annotation-"]').count();
|
||||||
|
|
||||||
// Enable annotate mode to show delete buttons
|
// Enable annotate mode to show delete buttons
|
||||||
await page.getByRole('button', { name: /^annotieren$/i }).click();
|
await page.getByRole('button', { name: /^annotieren$/i }).click();
|
||||||
@@ -339,7 +341,7 @@ test.describe('PDF annotations — admin', () => {
|
|||||||
await expect(deleteBtn).toBeVisible({ timeout: 8000 });
|
await expect(deleteBtn).toBeVisible({ timeout: 8000 });
|
||||||
await deleteBtn.click();
|
await deleteBtn.click();
|
||||||
|
|
||||||
await expect(page.locator('[data-testid^="annotation-"]')).toHaveCount(0, {
|
await expect(page.locator('[data-testid^="annotation-"]')).toHaveCount(countBefore - 1, {
|
||||||
timeout: 8000
|
timeout: 8000
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -407,7 +409,10 @@ test.describe('PDF annotations — file hash versioning', () => {
|
|||||||
await page.waitForSelector('[data-hydrated]');
|
await page.waitForSelector('[data-hydrated]');
|
||||||
await page.locator('canvas').first().waitFor({ state: 'visible', timeout: 20000 });
|
await page.locator('canvas').first().waitFor({ state: 'visible', timeout: 20000 });
|
||||||
|
|
||||||
await expect(page.locator('[data-testid^="annotation-"]')).toHaveCount(0, { timeout: 8000 });
|
// Use :not() to exclude the outdated-notice element whose testid also starts with "annotation-"
|
||||||
|
await expect(
|
||||||
|
page.locator('[data-testid^="annotation-"]:not([data-testid="annotation-outdated-notice"])')
|
||||||
|
).toHaveCount(0, { timeout: 8000 });
|
||||||
await expect(page.locator('[data-testid="annotation-outdated-notice"]')).toBeVisible({
|
await expect(page.locator('[data-testid="annotation-outdated-notice"]')).toBeVisible({
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user