From 49da99c8ac525b81033f2d25c47dd262d0724353 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 30 Jan 2023 10:59:54 +0000 Subject: [PATCH] Adding context update to test case since it used to rely on the context update functionality. --- .../functions/usageQuotas/tests/syncRows.spec.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/server/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts b/packages/server/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts index a5cb203e0f..51f6c2d301 100644 --- a/packages/server/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +++ b/packages/server/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts @@ -2,7 +2,7 @@ import TestConfig from "../../../../tests/utilities/TestConfiguration" import * as syncRows from "../syncRows" import { quotas } from "@budibase/pro" import { QuotaUsageType, StaticQuotaName } from "@budibase/types" -const { db: dbCore } = require("@budibase/backend-core") +import { db as dbCore, context } from "@budibase/backend-core" describe("syncRows", () => { let config = new TestConfig(false) @@ -24,13 +24,17 @@ describe("syncRows", () => { // app 1 const app1 = config.app - await config.createTable() - await config.createRow() + await context.doInAppContext(app1.appId, async () => { + await config.createTable() + await config.createRow() + }) // app 2 const app2 = await config.createApp("second-app") - await config.createTable() - await config.createRow() - await config.createRow() + await context.doInAppContext(app2.appId, async () => { + await config.createTable() + await config.createRow() + await config.createRow() + }) // migrate await syncRows.run()