(t *testing.T)
| 108 | } |
| 109 | |
| 110 | func TestProcessAttachment_PNG_WithAlpha_StaysPNG(t *testing.T) { |
| 111 | t.Parallel() |
| 112 | data := encodePNGBytes(100, 100, true) |
| 113 | path := writeTempFile(t, ".png", data) |
| 114 | |
| 115 | doc, err := chat.ProcessAttachment(t.Context(), chat.MessagePart{ |
| 116 | Type: chat.MessagePartTypeFile, |
| 117 | File: &chat.MessageFile{Path: path, MimeType: "image/png"}, |
| 118 | }) |
| 119 | require.NoError(t, err) |
| 120 | assert.True(t, doc.MimeType == "image/png" || doc.MimeType == "image/jpeg", |
| 121 | "expected png or jpeg, got %q", doc.MimeType) |
| 122 | assert.NotEmpty(t, doc.Source.InlineData) |
| 123 | } |
| 124 | |
| 125 | func TestProcessAttachment_ImageTooLarge_Resized(t *testing.T) { |
| 126 | t.Parallel() |
nothing calls this directly
no test coverage detected