Fix for email view casing test.
This commit is contained in:
parent
38b2c02cf6
commit
91eb2cfe6f
|
@ -4,15 +4,13 @@ const { getGlobalDB, doInTenant } = require("@budibase/backend-core/tenancy")
|
|||
|
||||
// mock email view creation
|
||||
const coreDb = require("@budibase/backend-core/db")
|
||||
const createUserEmailView = jest.fn()
|
||||
coreDb.createUserEmailView = createUserEmailView
|
||||
const createNewUserEmailView = jest.fn()
|
||||
coreDb.createNewUserEmailView = createNewUserEmailView
|
||||
|
||||
const migration = require("../userEmailViewCasing")
|
||||
|
||||
describe("run", () => {
|
||||
doInTenant(TENANT_ID, () => {
|
||||
let config = new TestConfig(false)
|
||||
const globalDb = getGlobalDB()
|
||||
|
||||
beforeEach(async () => {
|
||||
await config.init()
|
||||
|
@ -21,8 +19,10 @@ describe("run", () => {
|
|||
afterAll(config.end)
|
||||
|
||||
it("runs successfully", async () => {
|
||||
await doInTenant(TENANT_ID, async () => {
|
||||
const globalDb = getGlobalDB()
|
||||
await migration.run(globalDb)
|
||||
expect(createUserEmailView).toHaveBeenCalledTimes(1)
|
||||
expect(createNewUserEmailView).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue