1
0
Fork 0
mirror of synced 2024-09-21 20:01:32 +12:00
budibase/packages/worker/src/api/routes/tests/configs.spec.js
2021-08-05 09:59:08 +01:00

35 lines
No EOL
875 B
JavaScript

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", () => {
let request = setup.getRequest()
let config = setup.getConfig()
beforeAll(async () => {
await config.init()
})
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`)
.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)
})
})