@@ -842,34 +842,35 @@ describe('S3Adapter tests', () => {
842842 } ;
843843 const s3 = new S3Adapter ( options ) ;
844844 s3 . _s3Client = s3ClientMock ;
845-
846845 // Mock getFileLocation to return a presigned URL
847846 spyOn ( s3 , 'getFileLocation' ) . and . returnValue ( Promise . resolve ( 'https://presigned-url.com/file.txt' ) ) ;
848-
847+
849848 const result = await s3 . createFile (
850- 'file.txt' ,
851- 'hello world' ,
852- 'text/utf8' ,
849+ 'file.txt' ,
850+ 'hello world' ,
851+ 'text/utf8' ,
853852 { } ,
854853 { mount : 'http://example.com' , applicationId : 'test123' }
855854 ) ;
856-
857- expect ( result . url ) . toBe ( 'https://presigned-url.com/file.txt' ) ;
858- expect ( result . location ) . toBeDefined ( ) ;
859- expect ( result . name ) . toBe ( 'file.txt' ) ;
860- expect ( result . s3_response ) . toBeDefined ( ) ;
855+
856+ expect ( result ) . toEqual ( {
857+ location : jasmine . any ( String ) ,
858+ name : 'file.txt' ,
859+ s3_response : jasmine . any ( Object ) ,
860+ url : 'https://presigned-url.com/file.txt'
861+ } ) ;
861862 } ) ;
862863
863864 it ( 'should handle generateKey function errors' , async ( ) => {
864865 const options = {
865866 bucket : 'bucket-1' ,
866867 generateKey : ( ) => {
867- throw new Error ( 'Generate key failed' ) ;
868+ throw 'Generate key failed' ;
868869 }
869870 } ;
870871 const s3 = new S3Adapter ( options ) ;
871872 s3 . _s3Client = s3ClientMock ;
872-
873+
873874 await expectAsync (
874875 s3 . createFile ( 'file.txt' , 'hello world' , 'text/utf8' , { } )
875876 ) . toBeRejectedWithError ( 'Generate key failed' ) ;
0 commit comments