test(document): run OCR-status page tests as a writer (#697)
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m16s
CI / OCR Service Tests (pull_request) Successful in 21s
CI / Backend Unit Tests (pull_request) Successful in 3m30s
CI / fail2ban Regex (pull_request) Successful in 44s
CI / Semgrep Security Scan (pull_request) Successful in 19s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m3s
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m16s
CI / OCR Service Tests (pull_request) Successful in 21s
CI / Backend Unit Tests (pull_request) Successful in 3m30s
CI / fail2ban Regex (pull_request) Successful in 44s
CI / Semgrep Security Scan (pull_request) Successful in 19s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m3s
The OCR status check is now gated behind canWrite (readers do no write-path work), so the two OCR-status page tests must render as a writer — OCR is a writer action. Without canWrite the status check never fires and the "OCR läuft" spinner never mounts. Fixes the CI regression introduced by confining read-only users to the read view. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -360,7 +360,7 @@ describe('documents/[id] page', () => {
|
||||
try {
|
||||
mockPage.url = new URL('http://localhost/documents/d-ocr-fail?task=transcribe');
|
||||
render(DocumentDetailPage, {
|
||||
props: { data: baseData({ document: { ...baseDoc, id: 'd-ocr-fail' } }) }
|
||||
props: { data: baseData({ canWrite: true, document: { ...baseDoc, id: 'd-ocr-fail' } }) }
|
||||
});
|
||||
await vi.waitFor(() => {
|
||||
expect(document.querySelector('[data-testid="panel-close"]')).not.toBeNull();
|
||||
@@ -391,7 +391,7 @@ describe('documents/[id] page', () => {
|
||||
try {
|
||||
mockPage.url = new URL('http://localhost/documents/d-ocr-run?task=transcribe');
|
||||
render(DocumentDetailPage, {
|
||||
props: { data: baseData({ document: { ...baseDoc, id: 'd-ocr-run' } }) }
|
||||
props: { data: baseData({ canWrite: true, document: { ...baseDoc, id: 'd-ocr-run' } }) }
|
||||
});
|
||||
await expect.element(browserPage.getByText('OCR läuft')).toBeVisible();
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user