Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE-86] support xlsx files in attachments #87

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/allure/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const (
Webm MimeType = "video/webm"
Mpeg MimeType = "video/mpeg"

Pdf MimeType = "application/pdf"
Pdf MimeType = "application/pdf"
Xlsx MimeType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)

var mimeTypeMap = map[MimeType]string{
Expand All @@ -67,6 +68,7 @@ var mimeTypeMap = map[MimeType]string{
Webm: "webm",
Mpeg: "mpeg",
Pdf: "pdf",
Xlsx: "xlsx",
}

// NewAttachment - Constructor. Returns pointer to new attachment object.
Expand Down
4 changes: 4 additions & 0 deletions pkg/allure/attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func TestMimeTypeMap(t *testing.T) {
Webm: "webm",
Mpeg: "mpeg",
Pdf: "pdf",
Xlsx: "xlsx",
}
assert.Equal(t, len(_mimeTypeMap), len(mimeTypeMap), "Miss Some!")
for _type, _format := range _mimeTypeMap {
Expand Down Expand Up @@ -152,5 +153,8 @@ func TestMimeTypeMap(t *testing.T) {

var _Pdf MimeType = "application/pdf"
assert.Equal(t, _Pdf, Pdf)

var _Xlsx MimeType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
assert.Equal(t, _Xlsx, Xlsx)
})
}
Loading