From f3f874c3f95c2081b97142b7454c196038039a8e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 23 Sep 2020 15:29:25 +0100 Subject: [PATCH] Fixing delay as it was causing test case to be inconsistent (triggering automation) --- packages/server/src/api/routes/tests/automation.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/automation.spec.js b/packages/server/src/api/routes/tests/automation.spec.js index e132f5628e..807af1bc9a 100644 --- a/packages/server/src/api/routes/tests/automation.spec.js +++ b/packages/server/src/api/routes/tests/automation.spec.js @@ -170,6 +170,7 @@ describe("/automations", () => { expect(res.body.automation.name).toEqual(TEST_AUTOMATION.name) // wait for automation to complete in background for (let tries = 0; tries < MAX_RETRIES; tries++) { + await delay(500) let elements = await getAllFromModel(request, app._id, instance._id, model._id) // don't test it unless there are values to test if (elements.length === 1) { @@ -178,7 +179,6 @@ describe("/automations", () => { expect(elements[0].description).toEqual("TEST") return } - await delay(500) } throw "Failed to find the records" })