From 3830d6cff7eb46b0107765c993bc01b2e4f9f564 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 4 Oct 2024 14:45:11 +0200 Subject: [PATCH] Clean action between tests --- .../src/api/routes/tests/rowAction.spec.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/server/src/api/routes/tests/rowAction.spec.ts b/packages/server/src/api/routes/tests/rowAction.spec.ts index f36681a147..a373a35a66 100644 --- a/packages/server/src/api/routes/tests/rowAction.spec.ts +++ b/packages/server/src/api/routes/tests/rowAction.spec.ts @@ -534,11 +534,9 @@ describe("/rowsActions", () => { ) }) - let tableIdForDescribe: string let actionId1: string, actionId2: string - beforeAll(async () => { - tableIdForDescribe = tableId + beforeEach(async () => { for (const rowAction of createRowActionRequests(3)) { await createRowAction(tableId, rowAction) } @@ -549,11 +547,6 @@ describe("/rowsActions", () => { actionId2 = actions[1] }) - beforeEach(() => { - // Hack to reuse tables for these given tests - tableId = tableIdForDescribe - }) - it("can set table permission", async () => { await config.api.rowAction.unsetTablePermission(tableId, actionId1) await config.api.rowAction.unsetTablePermission(tableId, actionId2) @@ -622,11 +615,9 @@ describe("/rowsActions", () => { ) }) - let tableIdForDescribe: string let actionId1: string, actionId2: string let viewId1: string, viewId2: string - beforeAll(async () => { - tableIdForDescribe = tableId + beforeEach(async () => { for (const rowAction of createRowActionRequests(3)) { await createRowAction(tableId, rowAction) } @@ -648,11 +639,6 @@ describe("/rowsActions", () => { ).id }) - beforeEach(() => { - // Hack to reuse tables for these given tests - tableId = tableIdForDescribe - }) - it("can set permission views", async () => { await config.api.rowAction.setViewPermission(tableId, viewId1, actionId1) const action1Result = await config.api.rowAction.setViewPermission(