@@ -1030,7 +1030,15 @@ describe('Excel-Builder-Vanilla', () => {
1030
1030
test ( 'Drawings' , async ( ) => {
1031
1031
const fruitWorkbook = createWorkbook ( ) ;
1032
1032
const berryList = fruitWorkbook . createWorksheet ( { name : 'Berry List' } ) ;
1033
- const picRef = fruitWorkbook . addMedia ( 'image' , 'text.txt' , new Blob ( ) ) ;
1033
+ const picRef1 = fruitWorkbook . addMedia ( 'image' , 'file1.jpeg' , new Blob ( ) ) ;
1034
+ const picRef2 = fruitWorkbook . addMedia ( 'image' , 'file2.gif' , new Blob ( ) ) ;
1035
+ const picRef3 = fruitWorkbook . addMedia ( 'image' , 'file3.png' , new Blob ( ) , 'image/png' ) ;
1036
+ const picRef4 = fruitWorkbook . addMedia ( 'image' , 'file4.txt' , new Blob ( ) ) ;
1037
+
1038
+ expect ( picRef1 . contentType ) . toBe ( 'image/jpeg' ) ;
1039
+ expect ( picRef2 . contentType ) . toBe ( 'image/gif' ) ;
1040
+ expect ( picRef3 . contentType ) . toBe ( 'image/png' ) ;
1041
+ expect ( picRef4 . contentType ) . toBe ( null ) ;
1034
1042
1035
1043
const drawings = new Drawings ( ) ;
1036
1044
const strawberryPicture1 = new Picture ( ) ;
@@ -1045,7 +1053,7 @@ describe('Excel-Builder-Vanilla', () => {
1045
1053
} ,
1046
1054
} ) ;
1047
1055
1048
- strawberryPicture1 . setMedia ( picRef ) ;
1056
+ strawberryPicture1 . setMedia ( picRef1 ) ;
1049
1057
drawings . addDrawing ( strawberryPicture1 ) ;
1050
1058
1051
1059
const strawberryPicture2 = new Picture ( ) ;
@@ -1056,7 +1064,7 @@ describe('Excel-Builder-Vanilla', () => {
1056
1064
height : Positioning . pixelsToEMUs ( 300 ) ,
1057
1065
} ) ;
1058
1066
1059
- strawberryPicture2 . setMedia ( picRef ) ;
1067
+ strawberryPicture2 . setMedia ( picRef1 ) ;
1060
1068
drawings . addDrawing ( strawberryPicture2 ) ;
1061
1069
1062
1070
const strawberryPicture3 = new Picture ( ) ;
@@ -1067,7 +1075,7 @@ describe('Excel-Builder-Vanilla', () => {
1067
1075
height : Positioning . pixelsToEMUs ( 300 ) ,
1068
1076
} ) ;
1069
1077
1070
- strawberryPicture3 . setMedia ( picRef ) ;
1078
+ strawberryPicture3 . setMedia ( picRef1 ) ;
1071
1079
drawings . addDrawing ( strawberryPicture3 ) ;
1072
1080
1073
1081
berryList . addDrawings ( drawings ) ;
0 commit comments