diff --git a/tests/media_thumbnail_test.go b/tests/media_thumbnail_test.go index 74250a54..19a8cb5b 100644 --- a/tests/media_thumbnail_test.go +++ b/tests/media_thumbnail_test.go @@ -132,6 +132,7 @@ func TestFederationThumbnail(t *testing.T) { t.Fatalf("failed to parse multipart response: %s", err) } + foundImage := false reader := multipart.NewReader(resp.Body, params["boundary"]) for { p, err := reader.NextPart() @@ -151,8 +152,12 @@ func TestFederationThumbnail(t *testing.T) { if !bytes.Equal(imageBody, body) { t.Fatalf("body does not match uploaded file") } + foundImage = true } } + if !foundImage { + t.Fatalf("No image was found in response.") + } } func fetchAndValidateThumbnail(t *testing.T, c *client.CSAPI, mxcUri string, authenticated bool) {