remove empty notification tests

This commit is contained in:
Alex Holliday
2024-10-28 14:17:38 +08:00
parent 3980236580
commit b171b540b9

View File

@@ -419,12 +419,6 @@ describe("Monitor Controller - createMonitor", () => {
expect(next.firstCall.args[0]).to.be.an("error");
expect(next.firstCall.args[0].message).to.equal("Job error");
});
it("should fail validation with empty notifications", async () => {
req.body.notifications = [];
await createMonitor(req, res, next);
expect(next.firstCall.args[0]).to.be.an("error");
expect(next.firstCall.args[0].status).to.equal(422);
});
it("should return success message and data if all operations succeed", async () => {
const monitor = { _id: "123", save: sinon.stub() };
req.db.createMonitor.returns(monitor);
@@ -790,12 +784,6 @@ describe("Monitor Controller - editMonitor", () => {
expect(next.firstCall.args[0]).to.be.an("error");
expect(next.firstCall.args[0].message).to.equal("Add Job error");
});
it("should fail validation with empty notifications", async () => {
req.body.notifications = [];
await editMonitor(req, res, next);
expect(next.firstCall.args[0]).to.be.an("error");
expect(next.firstCall.args[0].status).to.equal(422);
});
it("should return success message with data if all operations succeed", async () => {
const monitor = { _id: "123" };
req.db.getMonitorById.returns({ teamId: "123" });