@@ -15,7 +15,7 @@ describe('local community engine', () => {
1515 it . each ( [
1616 [ 'test.pdf' , 'pdf' ] , [ 'test.pptx' , 'pptx' ] , [ 'test.docx' , 'docx' ] ,
1717 ] as const ) ( 'parses and converts %s without a cloud client' , async ( fixture , format ) => {
18- const root = tmp ( ) ; const source = path . resolve ( 'tests/test-data ' , fixture ) ; const out = path . join ( root , 'artifact' ) ;
18+ const root = tmp ( ) ; const source = path . resolve ( 'tests/generated ' , fixture ) ; const out = path . join ( root , 'artifact' ) ;
1919 const parsed = await runParse ( { input : await resolveInput ( source ) , inputLabel : source , out, flags : { } , common : { engine : 'local' } , preflight : 'off' } ) ;
2020 expect ( parsed ) . toMatchObject ( { engine : 'local' , format, reusedParse : false , irSchemaVersion : 'deckir.v1' } ) ;
2121 expect ( parsed . irKey ) . toBeUndefined ( ) ;
@@ -43,7 +43,7 @@ describe('local community engine', () => {
4343 } , 30_000 ) ;
4444
4545 it ( 'invalidates auto cache entries when the recorded parser major changes' , async ( ) => {
46- const root = tmp ( ) ; const source = path . resolve ( 'tests/test-data /test.docx' ) ; const out = path . join ( root , 'artifact' ) ;
46+ const root = tmp ( ) ; const source = path . resolve ( 'tests/generated /test.docx' ) ; const out = path . join ( root , 'artifact' ) ;
4747 await runParse ( { input : await resolveInput ( source ) , inputLabel : source , out, flags : { } , common : { engine : 'local' } , preflight : 'off' } ) ;
4848 const irFile = path . join ( out , 'ir.json' ) ; const manifestFile = path . join ( out , 'manifest.json' ) ;
4949 const ir = JSON . parse ( fs . readFileSync ( irFile , 'utf-8' ) ) ; const manifest = JSON . parse ( fs . readFileSync ( manifestFile , 'utf-8' ) ) ;
@@ -56,7 +56,7 @@ describe('local community engine', () => {
5656 } , 30_000 ) ;
5757
5858 it ( 'invalidates old local renderer views and removes stale split-page files' , async ( ) => {
59- const root = tmp ( ) ; const source = path . resolve ( 'tests/test-data /test.pptx' ) ; const out = path . join ( root , 'artifact' ) ;
59+ const root = tmp ( ) ; const source = path . resolve ( 'tests/generated /test.pptx' ) ; const out = path . join ( root , 'artifact' ) ;
6060 await runParse ( { input : await resolveInput ( source ) , inputLabel : source , out, flags : { } , common : { engine : 'local' } , preflight : 'off' } ) ;
6161 await runConvert ( { input : await resolveInput ( out ) , inputLabel : out , flags : { splitPages : true } , common : { engine : 'local' } } ) ;
6262 const page = path . join ( out , 'views/markdown/001.md' ) ; expect ( fs . existsSync ( page ) ) . toBe ( true ) ;
@@ -69,21 +69,21 @@ describe('local community engine', () => {
6969 } , 30_000 ) ;
7070
7171 it ( 'does not silently upload unsupported Keynote input' , async ( ) => {
72- const source = path . resolve ( 'tests/test-data /test.key' ) ; let cloudCalls = 0 ;
72+ const source = path . resolve ( 'tests/generated /test.key' ) ; let cloudCalls = 0 ;
7373 await expect ( runParse ( { input : await resolveInput ( source ) , inputLabel : source , out : path . join ( tmp ( ) , 'artifact' ) , flags : { } ,
7474 common : { engine : 'auto' } , preflight : 'off' , cloud : async ( ) => { cloudCalls += 1 ; throw new Error ( 'must not upload' ) ; } } ) ) . rejects . toMatchObject ( { code : 'unsupported' } ) ;
7575 expect ( cloudCalls ) . toBe ( 0 ) ;
7676 } ) ;
7777
7878 it ( 'does not silently ignore cloud-only PDF profiles' , async ( ) => {
79- const source = path . resolve ( 'tests/test-data /test.pdf' ) ; let cloudCalls = 0 ;
79+ const source = path . resolve ( 'tests/generated /test.pdf' ) ; let cloudCalls = 0 ;
8080 await expect ( runParse ( { input : await resolveInput ( source ) , inputLabel : source , out : path . join ( tmp ( ) , 'artifact' ) , flags : { profile : 'quality' } ,
8181 common : { engine : 'local' } , preflight : 'off' , cloud : async ( ) => { cloudCalls += 1 ; throw new Error ( 'must not upload' ) ; } } ) ) . rejects . toMatchObject ( { code : 'unsupported' } ) ;
8282 expect ( cloudCalls ) . toBe ( 0 ) ;
8383 } ) ;
8484
8585 it ( 'uses cloud for unsupported input only after auto upload authorization' , async ( ) => {
86- const source = path . resolve ( 'tests/test-data /test.key' ) ; let cloudCalls = 0 ;
86+ const source = path . resolve ( 'tests/generated /test.key' ) ; let cloudCalls = 0 ;
8787 const client = {
8888 parse : async ( ) => { cloudCalls += 1 ; return { taskId : 'cloud-1' , type : 'keynote.parseTextAndImage' , irKey : 'remote/key.json' , irSchemaVersion : 'keynote.v1' , ir : { slides : [ { text : 'Cloud result' } ] } } ; } ,
8989 convert : async ( ) => { throw new Error ( 'not used' ) ; } ,
@@ -97,15 +97,15 @@ describe('local community engine', () => {
9797 it ( 'makes zero network requests for local file parsing and conversion' , async ( ) => {
9898 const network = vi . spyOn ( globalThis , 'fetch' ) . mockRejectedValue ( new Error ( 'network forbidden' ) ) ;
9999 try {
100- const source = path . resolve ( 'tests/test-data /test.docx' ) ; const out = path . join ( tmp ( ) , 'artifact' ) ;
100+ const source = path . resolve ( 'tests/generated /test.docx' ) ; const out = path . join ( tmp ( ) , 'artifact' ) ;
101101 await runParse ( { input : await resolveInput ( source ) , inputLabel : source , out, flags : { } , common : { engine : 'local' } , preflight : 'off' } ) ;
102102 await runConvert ( { input : await resolveInput ( out ) , inputLabel : out , flags : { } , common : { engine : 'local' } } ) ;
103103 expect ( network ) . not . toHaveBeenCalled ( ) ;
104104 } finally { network . mockRestore ( ) ; }
105105 } ) ;
106106
107107 it ( 'validates Node SDK flags before starting local or cloud work' , async ( ) => {
108- const source = path . resolve ( 'tests/test-data /test.docx' ) ; const client = createClient ( ) ;
108+ const source = path . resolve ( 'tests/generated /test.docx' ) ; const client = createClient ( ) ;
109109 await expect ( client . parseEnvelope ( source , { trackedChanges : 'invalid' as never } ) ) . rejects . toMatchObject ( { code : 'usage_error' } ) ;
110110 await expect ( client . parseEnvelope ( source , { allowUpload : true } ) ) . rejects . toMatchObject ( { code : 'usage_error' } ) ;
111111 } ) ;
0 commit comments