Add missing test case

This commit is contained in:
Alex Holliday
2024-10-11 14:07:37 +08:00
parent 0374f5ad0b
commit fbdbf5897e

View File

@@ -85,6 +85,21 @@ describe("maintenanceWindowController - createMaintenanceWindows", () => {
).to.be.true;
stub.restore();
});
it("should return success message if all operations are successful with active set to undefined", async () => {
req.body.active = undefined;
stub = sinon.stub(jwt, "verify").callsFake(() => {
return { teamId: "123" };
});
await createMaintenanceWindows(req, res, next);
expect(res.status.firstCall.args[0]).to.equal(201);
expect(
res.json.calledOnceWith({
success: true,
msg: successMessages.MAINTENANCE_WINDOW_CREATE,
})
).to.be.true;
stub.restore();
});
});
describe("maintenanceWindowController - getMaintenanceWindowById", () => {