From ae83bb695e990cd9fe2302d8d278a633667cfeb7 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 13 May 2024 11:03:15 +0200 Subject: [PATCH 1/2] Fix tests depending on date --- packages/server/src/api/routes/tests/search.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index d036da646e..7a0e78eb1c 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -44,7 +44,7 @@ describe.each([ const snippets = [ { name: "WeeksAgo", - code: "return function (weeks) {\n const currentTime = new Date();\n currentTime.setDate(currentTime.getDate()-(7 * (weeks || 1)));\n return currentTime.toISOString();\n}", + code: `return function (weeks) {\n const currentTime = new Date(${Date.now()});\n currentTime.setDate(currentTime.getDate()-(7 * (weeks || 1)));\n return currentTime.toISOString();\n}`, }, ] From 9696f19eadbb14457963cef036485d8aaed129bc Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 13 May 2024 12:23:56 +0200 Subject: [PATCH 2/2] Fix test --- packages/server/src/automations/tests/executeQuery.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/automations/tests/executeQuery.spec.ts b/packages/server/src/automations/tests/executeQuery.spec.ts index 996e44af79..5a0688276d 100644 --- a/packages/server/src/automations/tests/executeQuery.spec.ts +++ b/packages/server/src/automations/tests/executeQuery.spec.ts @@ -88,7 +88,7 @@ describe.each( let res = await setup.runStep(setup.actions.EXECUTE_QUERY.stepId, { query: { queryId: "wrong_id" }, }) - expect(res.response).toEqual("Error: missing") + expect(res.response).toEqual("Error: CouchDB error: missing") expect(res.success).toEqual(false) }) })