From 292c87350aa97358357d3aeb10c48ff12d0c8e5e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 Jul 2024 10:58:09 +0200 Subject: [PATCH] Check automation creation --- .../server/src/api/routes/tests/rowAction.spec.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/routes/tests/rowAction.spec.ts b/packages/server/src/api/routes/tests/rowAction.spec.ts index a77f6bdd1a..9eadd7f4c8 100644 --- a/packages/server/src/api/routes/tests/rowAction.spec.ts +++ b/packages/server/src/api/routes/tests/rowAction.spec.ts @@ -110,8 +110,8 @@ describe("/rowsActions", () => { expect(res).toEqual( expect.objectContaining({ - name: "action name", - }) + name: "action name", + }) ) expect(await config.api.rowAction.find(tableId)).toEqual({ @@ -233,6 +233,17 @@ describe("/rowsActions", () => { await createRowAction(otherTable._id!, { name: action.name }) }) + + it("an automation is created when creating a new row action", async () => { + const action1 = await createRowAction(tableId, createRowActionRequest()) + const action2 = await createRowAction(tableId, createRowActionRequest()) + + for (const automationId of [action1.automationId, action2.automationId]) { + expect( + await config.api.automation.get(automationId, { status: 200 }) + ).toEqual(expect.objectContaining({ _id: automationId })) + } + }) }) describe("find", () => {