@@ -875,34 +875,35 @@ describe('S3Adapter tests', () => {
875875 } ;
876876 const s3 = new S3Adapter ( options ) ;
877877 s3 . _s3Client = s3ClientMock ;
878-
879878 // Mock getFileLocation to return a presigned URL
880879 spyOn ( s3 , 'getFileLocation' ) . and . returnValue ( Promise . resolve ( 'https://presigned-url.com/file.txt' ) ) ;
881-
880+
882881 const result = await s3 . createFile (
883- 'file.txt' ,
884- 'hello world' ,
885- 'text/utf8' ,
882+ 'file.txt' ,
883+ 'hello world' ,
884+ 'text/utf8' ,
886885 { } ,
887886 { mount : 'http://example.com' , applicationId : 'test123' }
888887 ) ;
889-
890- expect ( result . url ) . toBe ( 'https://presigned-url.com/file.txt' ) ;
891- expect ( result . location ) . toBeDefined ( ) ;
892- expect ( result . name ) . toBe ( 'file.txt' ) ;
893- expect ( result . s3_response ) . toBeDefined ( ) ;
888+
889+ expect ( result ) . toEqual ( {
890+ location : jasmine . any ( String ) ,
891+ name : 'file.txt' ,
892+ s3_response : jasmine . any ( Object ) ,
893+ url : 'https://presigned-url.com/file.txt'
894+ } ) ;
894895 } ) ;
895896
896897 it ( 'should handle generateKey function errors' , async ( ) => {
897898 const options = {
898899 bucket : 'bucket-1' ,
899900 generateKey : ( ) => {
900- throw new Error ( 'Generate key failed' ) ;
901+ throw 'Generate key failed' ;
901902 }
902903 } ;
903904 const s3 = new S3Adapter ( options ) ;
904905 s3 . _s3Client = s3ClientMock ;
905-
906+
906907 await expectAsync (
907908 s3 . createFile ( 'file.txt' , 'hello world' , 'text/utf8' , { } )
908909 ) . toBeRejectedWithError ( 'Generate key failed' ) ;
0 commit comments