@@ -434,20 +434,34 @@ describe('DataverseClient', () => {
434434 await client . getFile ( fileId )
435435
436436 assert . calledOnce ( axiosGetStub )
437- assert . calledWithExactly ( axiosGetStub , `${ host } /api/access/datafile/${ fileId } ` , {
437+ assert . calledWithExactly ( axiosGetStub , `${ host } /api/access/datafile/${ fileId } ?format=original ` , {
438438 headers : { 'X-Dataverse-key' : apiToken } ,
439439 responseType : 'arraybuffer'
440440 } )
441441 } )
442442
443+ describe ( 'get ingested file' , ( ) => {
444+ it ( 'should call axios with expected url' , async ( ) => {
445+ const fileId : string = random . number ( ) . toString ( )
446+
447+ await client . getFile ( fileId , false )
448+
449+ assert . calledOnce ( axiosGetStub )
450+ assert . calledWithExactly ( axiosGetStub , `${ host } /api/access/datafile/${ fileId } ` , {
451+ headers : { 'X-Dataverse-key' : apiToken } ,
452+ responseType : 'arraybuffer'
453+ } )
454+ } )
455+ } )
456+
443457 it ( 'should call axios with expected headers when no apiToken provided' , async ( ) => {
444458 client = new DataverseClient ( host )
445459 const fileId : string = random . number ( ) . toString ( )
446460
447461 await client . getFile ( fileId )
448462
449463 assert . calledOnce ( axiosGetStub )
450- assert . calledWithExactly ( axiosGetStub , `${ host } /api/access/datafile/${ fileId } ` , {
464+ assert . calledWithExactly ( axiosGetStub , `${ host } /api/access/datafile/${ fileId } ?format=original ` , {
451465 headers : { 'X-Dataverse-key' : '' } ,
452466 responseType : 'arraybuffer'
453467 } )
@@ -461,7 +475,7 @@ describe('DataverseClient', () => {
461475 'test' : randomValue
462476 }
463477 axiosGetStub
464- . withArgs ( `${ host } /api/access/datafile/${ fileId } ` , {
478+ . withArgs ( `${ host } /api/access/datafile/${ fileId } ?format=original ` , {
465479 headers : { 'X-Dataverse-key' : apiToken } ,
466480 responseType : 'arraybuffer'
467481 } )
0 commit comments