first 2 tests passing
This commit is contained in:
parent
24fc72657d
commit
d03b27f79f
|
@ -15,11 +15,16 @@ describe("addTenantToUrl", () => {
|
||||||
|
|
||||||
it("should append tenantId parameter to the URL query string", () => {
|
it("should append tenantId parameter to the URL query string", () => {
|
||||||
const url = "https://budibase.com?var=test"
|
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)
|
expect(addTenantToUrl(url)).toEqual(expectedUrl)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should not append tenantId parameter to the URL if isMultiTenant is false", () => {
|
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 url = "https://budibase.com"
|
||||||
const expectedUrl = "https://budibase.com"
|
const expectedUrl = "https://budibase.com"
|
||||||
expect(addTenantToUrl(url)).toEqual(expectedUrl)
|
expect(addTenantToUrl(url)).toEqual(expectedUrl)
|
||||||
|
|
Loading…
Reference in New Issue