diff --git a/app/build/plugins/bluesky/tests.js b/app/build/plugins/bluesky/tests.js index afce75c303f..bee0f6f92c6 100644 --- a/app/build/plugins/bluesky/tests.js +++ b/app/build/plugins/bluesky/tests.js @@ -2,7 +2,7 @@ describe("bluesky plugin", function () { const replaceURLsWithEmbeds = require("./index.js").render; const cheerio = require("cheerio"); - it("works", function () { + it("works", function (done) { // html bare link to a post on bluesky const html = 'https://bsky.app/profile/logicallyjc.bsky.social/post/3lbretguxqk2b'; @@ -10,12 +10,15 @@ describe("bluesky plugin", function () { const $ = cheerio.load(html); replaceURLsWithEmbeds($, function () { - expect($("a").length).toBe(0); + + console.log('html:', $.html()); + expect($("a[href='https://bsky.app/profile/logicallyjc.bsky.social/post/3lbretguxqk2b']").length).toBe(0); expect($("blockquote").length).toBe(1); + done(); }); }); - it("does not error when there are no links", function () { + it("does not error when there are no links", function (done) { const html = "

hello

"; const $ = cheerio.load(html); @@ -23,11 +26,12 @@ describe("bluesky plugin", function () { replaceURLsWithEmbeds($, function () { expect($("a").length).toBe(0); expect($("blockquote").length).toBe(0); + done(); }); }); // if the bluesky link is invalid or poorly formatted, it should not be replaced - it("does not error when the link is invalid", function () { + it("does not error when the link is invalid", function (done) { const html = 'https://bsky.app'; const $ = cheerio.load(html); @@ -35,6 +39,7 @@ describe("bluesky plugin", function () { replaceURLsWithEmbeds($, function () { expect($("a").length).toBe(1); expect($("blockquote").length).toBe(0); + done(); }); }); });