1
0
Fork 0
mirror of synced 2024-10-06 04:54:52 +13:00

first 2 tests passing

This commit is contained in:
Mateus Badan de Pieri 2023-03-30 17:08:18 +01:00
parent 24fc72657d
commit d03b27f79f

View file

@ -15,11 +15,16 @@ describe("addTenantToUrl", () => {
it("should append tenantId parameter to the URL query string", () => {
const url = "https://budibase.com?var=test"
const expectedUrl = "https://budibase.com?var=test&tenantId=default"
const expectedUrl = "https://budibase.com?var=test&tenantId=budibase"
expect(addTenantToUrl(url)).toEqual(expectedUrl)
})
it("should not append tenantId parameter to the URL if isMultiTenant is false", () => {
// mock the `isMultiTenant` function to return false
jest.mock("../../src/context", () => ({
isMultiTenant: jest.fn(() => false),
}))
const url = "https://budibase.com"
const expectedUrl = "https://budibase.com"
expect(addTenantToUrl(url)).toEqual(expectedUrl)