latest version

This commit is contained in:
Mateus Badan de Pieri 2023-04-11 10:22:47 +01:00
parent f1b7ff0f7c
commit de613d2b28
1 changed files with 6 additions and 6 deletions

View File

@ -1,15 +1,10 @@
// mock the `getTenantId` and `isMultiTenant` functions
jest.mock("../../context", () => ({
getTenantId: jest.fn(() => "budibase"),
isMultiTenant: jest.fn(() => true),
}))
import { TenantResolutionStrategy } from "@budibase/types" import { TenantResolutionStrategy } from "@budibase/types"
import { addTenantToUrl, isUserInAppTenant, getTenantIDFromCtx } from "../" import { addTenantToUrl, isUserInAppTenant, getTenantIDFromCtx } from "../"
import { import {
isMultiTenant, isMultiTenant,
getTenantIDFromAppID, getTenantIDFromAppID,
DEFAULT_TENANT_ID, DEFAULT_TENANT_ID,
getTenantId,
} from "../../context" } from "../../context"
import { any } from "joi" import { any } from "joi"
const mockedIsMultiTenant = isMultiTenant as jest.MockedFunction< const mockedIsMultiTenant = isMultiTenant as jest.MockedFunction<
@ -18,6 +13,11 @@ const mockedIsMultiTenant = isMultiTenant as jest.MockedFunction<
const mockedGetTenantIDFromAppID = getTenantIDFromAppID as jest.MockedFunction< const mockedGetTenantIDFromAppID = getTenantIDFromAppID as jest.MockedFunction<
typeof getTenantIDFromAppID typeof getTenantIDFromAppID
> >
// mock the `getTenantId` and `isMultiTenant` functions
jest.mock("../../context", () => ({
getTenantId: jest.fn(() => "budibase"),
isMultiTenant: jest.fn(() => true),
}))
describe("addTenantToUrl", () => { describe("addTenantToUrl", () => {
it("should append tenantId parameter to the URL", () => { it("should append tenantId parameter to the URL", () => {
const url = "https://budibase.com" const url = "https://budibase.com"