Skip to content

Commit

Permalink
add a test for generating thumbnail for twitter links
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinse12 committed Aug 31, 2023
1 parent d39cffd commit 2724314
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/node/subplebbit/misc.subplebbit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,15 @@ describe(`comment.link`, async () => {
expect(thumbnailInfo.thumbnailHeight).to.equal(497);
});

it(`Generates thumbnail url for twitter urls correctly`, async () => {
const url = "https://twitter.com/eustatheia/status/1691285870244937728";
const expectedThumbnailUrl = "https://pbs.twimg.com/media/F3iniP-XcAA1TVU.jpg:large";
const thumbnailInfo = await getThumbnailUrlOfLink(url);
expect(thumbnailInfo.thumbnailUrl).to.equal(expectedThumbnailUrl);
expect(thumbnailInfo.thumbnailWidth).to.equal(1125);
expect(thumbnailInfo.thumbnailHeight).to.equal(1315);
});

it(`comment.thumbnailUrl is populated by subplebbit in challengeVerification`, async () => {
const link = "https://www.youtube.com/watch?v=TLysAkFM4cA";
const post = await publishRandomPost(subplebbit.address, plebbit, { link }, false);
Expand Down

0 comments on commit 2724314

Please sign in to comment.