From e87fd9d0a504197903817dcdc2d10d2f1c51f1ae Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 26 May 2022 17:31:57 +0100 Subject: [PATCH] Updating test cases. --- packages/server/src/api/routes/tests/row.spec.js | 3 ++- .../functions/tests/{quotas1.spec.js => quotas2.spec.js} | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename packages/server/src/migrations/functions/tests/{quotas1.spec.js => quotas2.spec.js} (88%) diff --git a/packages/server/src/api/routes/tests/row.spec.js b/packages/server/src/api/routes/tests/row.spec.js index e051c38763..b553a210e7 100644 --- a/packages/server/src/api/routes/tests/row.spec.js +++ b/packages/server/src/api/routes/tests/row.spec.js @@ -35,7 +35,8 @@ describe("/rows", () => { } const getQueryUsage = async () => { - return config.doInContext(null, () => quotas.getAllCurrentUsageValue(QuotaUsageType.MONTHLY, MonthlyQuotaName.QUERIES)) + const { total } = await config.doInContext(null, () => quotas.getAllCurrentUsageValue(QuotaUsageType.MONTHLY, MonthlyQuotaName.QUERIES)) + return total } const assertRowUsage = async (expected) => { diff --git a/packages/server/src/migrations/functions/tests/quotas1.spec.js b/packages/server/src/migrations/functions/tests/quotas2.spec.js similarity index 88% rename from packages/server/src/migrations/functions/tests/quotas1.spec.js rename to packages/server/src/migrations/functions/tests/quotas2.spec.js index 64b186ab92..552eba7701 100644 --- a/packages/server/src/migrations/functions/tests/quotas1.spec.js +++ b/packages/server/src/migrations/functions/tests/quotas2.spec.js @@ -4,7 +4,7 @@ const syncApps = jest.fn() const syncRows = jest.fn() jest.mock("../usageQuotas/syncApps", () => ({ run: syncApps }) ) -jest.mock("../usageQuotas/syncRows", () => ({ run: syncRows }) ) +jest.mock("../usageQuotas/syncAppRows", () => ({ run: syncRows }) ) const migration = require("../quotas2")