From b73f6d1d7e579a339edd3d6d0395dc025c36c050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Omar=20Vergara=20P=C3=A9rez?= Date: Sun, 21 Jan 2024 09:44:28 -0600 Subject: [PATCH] test(documents): add test for the rest of the images formats --- pkg/files/documents/documents_test.go | 54 ++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/pkg/files/documents/documents_test.go b/pkg/files/documents/documents_test.go index 6f65710..30778c2 100644 --- a/pkg/files/documents/documents_test.go +++ b/pkg/files/documents/documents_test.go @@ -48,7 +48,8 @@ func TestPDFToImages(t *testing.T) { expected: expected{ mimetype: "application/zip", }, - }, { + }, + { name: "pdf to png", input: input{ filename: "testdata/bitcoin.pdf", @@ -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 {