File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ class Download {
2323 return false ;
2424 }
2525
26- const blob = new this . BlobCtor ( [ text ] , { type : mimeType } ) ;
26+ const blob = new this . BlobCtor ( [ text ] , {
27+ type : mimeType ,
28+ endings : 'transparent' ,
29+ } ) ;
2730 const url = this . URLObj . createObjectURL ( blob ) ;
2831 const element = this . documentObj . createElement ( 'a' ) ;
2932 element . setAttribute ( 'href' , url ) ;
Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ describe('Download', () => {
3535
3636 download . downloadFile ( 'hello world' ) ;
3737
38- expect ( BlobCtor ) . toHaveBeenCalledWith ( [ 'hello world' ] , { type : 'text/plain;charset=utf-8' } ) ;
38+ expect ( BlobCtor ) . toHaveBeenCalledWith ( [ 'hello world' ] , {
39+ type : 'text/plain;charset=utf-8' ,
40+ endings : 'transparent' ,
41+ } ) ;
3942 expect ( URLObj . createObjectURL ) . toHaveBeenCalledTimes ( 1 ) ;
4043 expect ( appendSpy ) . toHaveBeenCalledTimes ( 1 ) ;
4144 const anchor = appendSpy . mock . calls [ 0 ] [ 0 ] ;
@@ -91,6 +94,7 @@ describe('Download', () => {
9194
9295 expect ( ownerWindowObj . Blob ) . toHaveBeenCalledWith ( [ 'owner-window-text' ] , {
9396 type : 'text/plain;charset=utf-8' ,
97+ endings : 'transparent' ,
9498 } ) ;
9599 expect ( ownerWindowObj . URL . createObjectURL ) . toHaveBeenCalledTimes ( 1 ) ;
96100 expect ( global . URL . createObjectURL ) . not . toHaveBeenCalled ( ) ;
You can’t perform that action at this time.
0 commit comments