Transcode link preview images
This commit is contained in:
parent
fd610a6300
commit
40f16b98e2
2 changed files with 33 additions and 18 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue