1
0
Fork 0
mirror of synced 2024-09-21 11:53:49 +12:00
budibase/packages/worker/src/api/routes/tests/configs.spec.js

35 lines
875 B
JavaScript
Raw Normal View History

2021-05-06 21:54:01 +12:00
const setup = require("./utilities")
// mock the email system
jest.mock("nodemailer")
const nodemailer = require("nodemailer")
nodemailer.createTransport.mockReturnValue({
verify: jest.fn()
})
describe("/api/global/configs/checklist", () => {
2021-05-06 21:54:01 +12:00
let request = setup.getRequest()
let config = setup.getConfig()
beforeAll(async () => {
await config.init()
2021-05-06 21:54:01 +12:00
})
afterAll(setup.afterAll)
it("should return the correct checklist status based on the state of the budibase installation", async () => {
await config.saveSmtpConfig()
const res = await request
.get(`/api/global/configs/checklist`)
2021-05-06 21:54:01 +12:00
.set(config.defaultHeaders())
.expect("Content-Type", /json/)
.expect(200)
const checklist = res.body
expect(checklist.apps).toBe(0)
expect(checklist.smtp).toBe(true)
expect(checklist.adminUser).toBe(true)
})
})