diff --git a/packages/api/src/files/code/extract.spec.ts b/packages/api/src/files/code/extract.spec.ts index 99407ca1c2..500971d9f1 100644 --- a/packages/api/src/files/code/extract.spec.ts +++ b/packages/api/src/files/code/extract.spec.ts @@ -371,5 +371,49 @@ describe('extractCodeArtifactText', () => { // assertion is that we don't crash and don't leak the bomb error. expect(text).toBe(docxText); }); + + /* Regression for Codex P2 review on PR #12934. The classifier returns + * 'other' for a small but real set of inputs that the new dispatcher + * can still route — extensionless `application/csv`, extensionless + * office MIMEs with parameters, etc. The early `category === 'other'` + * return must NOT short-circuit before `hasOfficeHtmlPath` is checked, + * or those inputs silently lose the rich preview. */ + it('routes extensionless application/csv through office HTML even when category=other', async () => { + mockOfficeHtml.mockResolvedValueOnce('
| 1 |