Merge branch 'master' into merge-master
This commit is contained in:
commit
8590f865b5
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "2.8.22-alpha.4",
|
"version": "2.8.22",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 347ee5326812c01ef07f0e744f691ab4823e185a
|
Subproject commit 44fa63cc0f536648ac57ba61b62c60dd2812dbc6
|
|
@ -1,6 +1,10 @@
|
||||||
const actual = jest.requireActual("@budibase/pro")
|
const actual = jest.requireActual("@budibase/pro")
|
||||||
const pro = {
|
const pro = {
|
||||||
...actual,
|
...actual,
|
||||||
|
features: {
|
||||||
|
...actual.features,
|
||||||
|
isSSOEnforced: jest.fn(),
|
||||||
|
},
|
||||||
licensing: {
|
licensing: {
|
||||||
keys: {
|
keys: {
|
||||||
activateLicenseKey: jest.fn(),
|
activateLicenseKey: jest.fn(),
|
||||||
|
|
|
@ -277,6 +277,7 @@ describe("configs", () => {
|
||||||
describe("GET /api/global/configs/public", () => {
|
describe("GET /api/global/configs/public", () => {
|
||||||
it("should return the expected public settings", async () => {
|
it("should return the expected public settings", async () => {
|
||||||
await saveSettingsConfig()
|
await saveSettingsConfig()
|
||||||
|
mocks.pro.features.isSSOEnforced.mockResolvedValue(false)
|
||||||
|
|
||||||
const res = await config.api.configs.getPublicSettings()
|
const res = await config.api.configs.getPublicSettings()
|
||||||
const body = res.body as GetPublicSettingsResponse
|
const body = res.body as GetPublicSettingsResponse
|
||||||
|
|
|
@ -1,14 +1,9 @@
|
||||||
import { structures } from "../../../tests"
|
import { structures, mocks } from "../../../tests"
|
||||||
import { mocks } from "@budibase/backend-core/tests"
|
|
||||||
import { env, context } from "@budibase/backend-core"
|
import { env, context } from "@budibase/backend-core"
|
||||||
import * as users from "../users"
|
import * as users from "../users"
|
||||||
import { CloudAccount } from "@budibase/types"
|
import { CloudAccount } from "@budibase/types"
|
||||||
import { isPreventPasswordActions } from "../users"
|
import { isPreventPasswordActions } from "../users"
|
||||||
|
|
||||||
jest.mock("@budibase/pro")
|
|
||||||
import * as _pro from "@budibase/pro"
|
|
||||||
const pro = jest.mocked(_pro, true)
|
|
||||||
|
|
||||||
describe("users", () => {
|
describe("users", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks()
|
jest.clearAllMocks()
|
||||||
|
@ -56,7 +51,7 @@ describe("users", () => {
|
||||||
it("returns true for all users when sso is enforced", async () => {
|
it("returns true for all users when sso is enforced", async () => {
|
||||||
await context.doInTenant(structures.tenant.id(), async () => {
|
await context.doInTenant(structures.tenant.id(), async () => {
|
||||||
const user = structures.users.user()
|
const user = structures.users.user()
|
||||||
pro.features.isSSOEnforced.mockResolvedValueOnce(true)
|
mocks.pro.features.isSSOEnforced.mockResolvedValueOnce(true)
|
||||||
const result = await users.isPreventPasswordActions(user)
|
const result = await users.isPreventPasswordActions(user)
|
||||||
expect(result).toBe(true)
|
expect(result).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue