From 30190866f8c2c6189105d34cb6b508f4917b4564 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 25 Jul 2022 08:59:30 +0100 Subject: [PATCH] test: Flakey test --- server/queues/tasks/ImportNotionTask.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/queues/tasks/ImportNotionTask.test.ts b/server/queues/tasks/ImportNotionTask.test.ts index a8c7838dd..68887aa51 100644 --- a/server/queues/tasks/ImportNotionTask.test.ts +++ b/server/queues/tasks/ImportNotionTask.test.ts @@ -74,7 +74,11 @@ describe("ImportNotionTask", () => { // Check that the image url was replaced in the text with a redirect const attachments = Array.from(response.attachments.values()); + const attachment = attachments.find((att) => + att.key.endsWith("Screen_Shot_2022-04-21_at_2.23.26_PM.png") + ); + const documents = Array.from(response.documents.values()); - expect(documents[1].text).toContain(attachments[1].redirectUrl); + expect(documents[1].text).toContain(attachment?.redirectUrl); }); });