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

36 lines
905 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({
2021-09-07 01:49:38 +12:00
verify: jest.fn(),
2021-05-06 21:54:01 +12:00
})
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)
2021-09-07 01:49:38 +12:00
2021-05-06 21:54:01 +12:00
const checklist = res.body
2021-09-07 01:49:38 +12:00
expect(checklist.apps.checked).toBeFalsy()
expect(checklist.smtp.checked).toBeTruthy()
expect(checklist.adminUser.checked).toBeTruthy()
2021-05-06 21:54:01 +12:00
})
2021-09-07 01:49:38 +12:00
})