Skip to content

Commit

Permalink
test(images): add a test cases to validate pnf to pdf transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
danvergara committed Jan 9, 2024
1 parent 895a5f3 commit ac54a6e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions pkg/files/images/images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func TestConvertImage(t *testing.T) {
images.TIFF,
images.BMP,
},
"Document": {
images.PDF,
},
},
},
},
Expand Down Expand Up @@ -125,6 +128,9 @@ func TestConvertImage(t *testing.T) {
images.TIFF,
images.BMP,
},
"Document": {
images.PDF,
},
},
},
},
Expand Down Expand Up @@ -196,6 +202,32 @@ func TestConvertImage(t *testing.T) {
},
},
},
{
name: "png to pdf",
input: input{
filename: "testdata/gopher_pirate.png",
mimetype: "image/png",
targetFileType: "Document",
targetFormat: "pdf",
imager: images.NewPng(),
},
expected: expected{
mimetype: "application/pdf",
supportedFormats: map[string][]string{
"Image": {
images.JPG,
images.JPEG,
images.GIF,
images.WEBP,
images.TIFF,
images.BMP,
},
"Document": {
images.PDF,
},
},
},
},
}

for _, tc := range tests {
Expand Down

0 comments on commit ac54a6e

Please sign in to comment.