Skip to content

Commit

Permalink
test(documents): add test for the rest of the images formats
Browse files Browse the repository at this point in the history
  • Loading branch information
danvergara committed Jan 21, 2024
1 parent 3df5090 commit b73f6d1
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion pkg/files/documents/documents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ func TestPDFToImages(t *testing.T) {
expected: expected{
mimetype: "application/zip",
},
}, {
},
{
name: "pdf to png",
input: input{
filename: "testdata/bitcoin.pdf",
Expand All @@ -61,6 +62,57 @@ func TestPDFToImages(t *testing.T) {
mimetype: "application/zip",
},
},
{
name: "pdf to gif",
input: input{
filename: "testdata/bitcoin.pdf",
mimetype: "application/pdf",
targetFileType: "Image",
targetFormat: "gif",
documenter: documents.NewPdf("bitcoin.pdf"),
},
expected: expected{
mimetype: "application/zip",
},
},
{
name: "pdf to webp",
input: input{
filename: "testdata/bitcoin.pdf",
mimetype: "application/pdf",
targetFileType: "Image",
targetFormat: "webp",
documenter: documents.NewPdf("bitcoin.pdf"),
},
expected: expected{
mimetype: "application/zip",
},
},
{
name: "pdf to tiff",
input: input{
filename: "testdata/bitcoin.pdf",
mimetype: "application/pdf",
targetFileType: "Image",
targetFormat: "tiff",
documenter: documents.NewPdf("bitcoin.pdf"),
},
expected: expected{
mimetype: "application/zip",
},
}, {
name: "pdf to bmp",
input: input{
filename: "testdata/bitcoin.pdf",
mimetype: "application/pdf",
targetFileType: "Image",
targetFormat: "bmp",
documenter: documents.NewPdf("bitcoin.pdf"),
},
expected: expected{
mimetype: "application/zip",
},
},
}

for _, tc := range tests {
Expand Down

0 comments on commit b73f6d1

Please sign in to comment.