test(ocr): guard translateOcrProgress fallback for PREPROCESSING_PAGE with missing colon parts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -77,6 +77,12 @@ describe('translateOcrProgress', () => {
|
||||
expect(result.totalPages).toBe(10);
|
||||
});
|
||||
|
||||
it('PREPROCESSING_PAGE with no colon parts gracefully falls back to zero', () => {
|
||||
const result = translateOcrProgress('PREPROCESSING_PAGE');
|
||||
expect(result.currentPage).toBe(0);
|
||||
expect(result.totalPages).toBe(0);
|
||||
});
|
||||
|
||||
it('translates ERROR', () => {
|
||||
expect(translateOcrProgress('ERROR').message).toBe('OCR fehlgeschlagen');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user