diff --git a/lerna.json b/lerna.json index b327205215..d06a1574d6 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.22-alpha.4", + "version": "2.8.22", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/pro b/packages/pro index 347ee53268..44fa63cc0f 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 347ee5326812c01ef07f0e744f691ab4823e185a +Subproject commit 44fa63cc0f536648ac57ba61b62c60dd2812dbc6 diff --git a/packages/worker/__mocks__/@budibase/pro.ts b/packages/worker/__mocks__/@budibase/pro.ts index 59c7939111..9364ae065d 100644 --- a/packages/worker/__mocks__/@budibase/pro.ts +++ b/packages/worker/__mocks__/@budibase/pro.ts @@ -1,6 +1,10 @@ const actual = jest.requireActual("@budibase/pro") const pro = { ...actual, + features: { + ...actual.features, + isSSOEnforced: jest.fn(), + }, licensing: { keys: { activateLicenseKey: jest.fn(), diff --git a/packages/worker/src/api/routes/global/tests/configs.spec.ts b/packages/worker/src/api/routes/global/tests/configs.spec.ts index 193dbf4a59..0a2073598a 100644 --- a/packages/worker/src/api/routes/global/tests/configs.spec.ts +++ b/packages/worker/src/api/routes/global/tests/configs.spec.ts @@ -277,6 +277,7 @@ describe("configs", () => { describe("GET /api/global/configs/public", () => { it("should return the expected public settings", async () => { await saveSettingsConfig() + mocks.pro.features.isSSOEnforced.mockResolvedValue(false) const res = await config.api.configs.getPublicSettings() const body = res.body as GetPublicSettingsResponse diff --git a/packages/worker/src/sdk/users/tests/users.spec.ts b/packages/worker/src/sdk/users/tests/users.spec.ts index a24f074512..50d3ec5a9b 100644 --- a/packages/worker/src/sdk/users/tests/users.spec.ts +++ b/packages/worker/src/sdk/users/tests/users.spec.ts @@ -1,14 +1,9 @@ -import { structures } from "../../../tests" -import { mocks } from "@budibase/backend-core/tests" +import { structures, mocks } from "../../../tests" import { env, context } from "@budibase/backend-core" import * as users from "../users" import { CloudAccount } from "@budibase/types" import { isPreventPasswordActions } from "../users" -jest.mock("@budibase/pro") -import * as _pro from "@budibase/pro" -const pro = jest.mocked(_pro, true) - describe("users", () => { beforeEach(() => { jest.clearAllMocks() @@ -56,7 +51,7 @@ describe("users", () => { it("returns true for all users when sso is enforced", async () => { await context.doInTenant(structures.tenant.id(), async () => { const user = structures.users.user() - pro.features.isSSOEnforced.mockResolvedValueOnce(true) + mocks.pro.features.isSSOEnforced.mockResolvedValueOnce(true) const result = await users.isPreventPasswordActions(user) expect(result).toBe(true) })