From 491266c7ba31c4b835344fc1ceccfb41a61c544a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 Jul 2024 11:01:09 +0200 Subject: [PATCH] Add more tests --- .../src/api/routes/tests/rowAction.spec.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/server/src/api/routes/tests/rowAction.spec.ts b/packages/server/src/api/routes/tests/rowAction.spec.ts index 9eadd7f4c8..f9e1c502f4 100644 --- a/packages/server/src/api/routes/tests/rowAction.spec.ts +++ b/packages/server/src/api/routes/tests/rowAction.spec.ts @@ -440,5 +440,26 @@ describe("/rowsActions", () => { status: 400, }) }) + + it("deletes the linked automation", async () => { + const actions: RowActionResponse[] = [] + for (const rowAction of createRowActionRequests(3)) { + actions.push(await createRowAction(tableId, rowAction)) + } + + const actionToDelete = _.sample(actions)! + await config.api.rowAction.delete(tableId, actionToDelete.id, { + status: 204, + }) + + await config.api.automation.get(actionToDelete.automationId, { + status: 404, + }) + for (const action of actions.filter(a => a.id !== actionToDelete.id)) { + await config.api.automation.get(action.automationId, { + status: 200, + }) + } + }) }) })