@@ -68,6 +68,12 @@ import {
6868} from '@/lib/workspace-files/search/index-state'
6969import { indexWorkspaceFileForSearch } from '@/lib/workspace-files/search/indexing'
7070
71+ async function requireDocxFormat ( ) {
72+ const format = await getE2BDocFormat ( 'report.docx' )
73+ if ( ! format ) throw new Error ( 'DOCX rendering format is required for this fixture' )
74+ return format
75+ }
76+
7177const storageRoot = mkdtempSync ( join ( tmpdir ( ) , 'sim-file-owner-search-' ) )
7278setUploadDirServer ( storageRoot )
7379const fixtures : {
@@ -776,7 +782,7 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
776782 artifact ,
777783 fileDocumentCacheIdentity (
778784 source ,
779- ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
785+ await requireDocxFormat ( ) ,
780786 'text/plain' ,
781787 fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
782788 )
@@ -873,7 +879,7 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
873879 'docx' ,
874880 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ,
875881 artifact ,
876- fileDocumentCacheIdentity ( source , ( await getE2BDocFormat ( 'transition.docx' ) ) ! , 'text/plain' )
882+ fileDocumentCacheIdentity ( source , await requireDocxFormat ( ) , 'text/plain' )
877883 )
878884 const input = { projectId : f . projectId , fileId : generated . file . id , maxBytes : 1_000_000 }
879885 const rendered = await readProjectFileArtifact . execute ( { principal : f . reader , input } )
@@ -996,7 +1002,7 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
9961002 ) ,
9971003 fileDocumentCacheIdentity (
9981004 source ,
999- ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
1005+ await requireDocxFormat ( ) ,
10001006 'text/plain' ,
10011007 fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
10021008 )
@@ -1007,7 +1013,7 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
10071013 'docx' ,
10081014 fileDocumentCacheIdentity (
10091015 source ,
1010- ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
1016+ await requireDocxFormat ( ) ,
10111017 'text/plain' ,
10121018 fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
10131019 )
@@ -1089,7 +1095,7 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
10891095 ) ,
10901096 fileDocumentCacheIdentity (
10911097 source ,
1092- ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
1098+ await requireDocxFormat ( ) ,
10931099 'text/plain' ,
10941100 fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
10951101 )
@@ -1100,7 +1106,7 @@ describe('owner-scoped indexed file search on PostgreSQL and stored bytes', () =
11001106 'docx' ,
11011107 fileDocumentCacheIdentity (
11021108 source ,
1103- ( await getE2BDocFormat ( 'report.docx' ) ) ! ,
1109+ await requireDocxFormat ( ) ,
11041110 'text/plain' ,
11051111 fileDocumentInputIdentity ( f . owner , [ dependencyRow ] )
11061112 )
0 commit comments