File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ describe('MediaApi', () => {
1010
1111 const binaryMediaData = '123456' ;
1212 const mediaFileData = fs . readFileSync ( './tests/fixtures/nodejs_cat.jpeg' ) ;
13- const binaryMediaName = `nodejs_binary_media${ randomUUID ( ) } ` ;
14- const mediaFileName = `nodejs_media_file${ randomUUID ( ) } ` ;
13+ const binaryMediaName = `nodejs_binary_media${ randomUUID ( ) } .txt ` ;
14+ const mediaFileName = `nodejs_media_file${ randomUUID ( ) } .jpeg ` ;
1515
1616 const getHash = ( data : BinaryLike ) => {
1717 return createHash ( 'md5' ) . update ( data ) . digest ( 'hex' ) ;
@@ -20,13 +20,23 @@ describe('MediaApi', () => {
2020
2121 describe ( 'uploadMedia' , ( ) => {
2222 test ( 'should upload binary media' , async ( ) => {
23- const { status } = await mediaApi . uploadMedia ( BW_ACCOUNT_ID , binaryMediaName , binaryMediaData ) ;
23+ const { status } = await mediaApi . uploadMedia (
24+ BW_ACCOUNT_ID ,
25+ binaryMediaName ,
26+ binaryMediaData ,
27+ 'text/plain'
28+ ) ;
2429
2530 expect ( status ) . toEqual ( 204 ) ;
2631 } ) ;
2732
2833 test ( 'should upload media file' , async ( ) => {
29- const { status } = await mediaApi . uploadMedia ( BW_ACCOUNT_ID , mediaFileName , mediaFileData ) ;
34+ const { status } = await mediaApi . uploadMedia (
35+ BW_ACCOUNT_ID ,
36+ mediaFileName ,
37+ mediaFileData ,
38+ 'image/jpeg'
39+ ) ;
3040
3141 expect ( status ) . toEqual ( 204 ) ;
3242 } ) ;
You can’t perform that action at this time.
0 commit comments