Transcode link preview images

This commit is contained in:
Fedor Indutny 2022-04-25 13:56:59 -07:00 committed by GitHub
parent fd610a6300
commit 40f16b98e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 18 deletions

View file

@ -1151,15 +1151,14 @@ describe('link preview fetching', () => {
);
assert.deepEqual(
await fetchLinkPreviewImage(
fakeFetch,
'https://example.com/img',
new AbortController().signal
),
{
data: fixture,
contentType: stringToMIMEType(contentType),
}
(
await fetchLinkPreviewImage(
fakeFetch,
'https://example.com/img',
new AbortController().signal
)
)?.contentType,
stringToMIMEType(contentType)
);
});
});
@ -1238,15 +1237,14 @@ describe('link preview fetching', () => {
);
assert.deepEqual(
await fetchLinkPreviewImage(
fakeFetch,
'https://example.com/img',
new AbortController().signal
),
{
data: fixture,
contentType: IMAGE_JPEG,
}
(
await fetchLinkPreviewImage(
fakeFetch,
'https://example.com/img',
new AbortController().signal
)
)?.contentType,
IMAGE_JPEG
);
sinon.assert.calledTwice(fakeFetch);