remove empty notification tests
This commit is contained in:
1 parent
3980236580
commit
b171b540b9
1 file changed
-12
@@ -419,12 +419,6 @@ describe("Monitor Controller - createMonitor", () => {
|
|||||||
expect(next.firstCall.args[0]).to.be.an("error");
|
expect(next.firstCall.args[0]).to.be.an("error");
|
||||||
expect(next.firstCall.args[0].message).to.equal("Job 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 () => {
|
it("should return success message and data if all operations succeed", async () => {
|
||||||
const monitor = { _id: "123", save: sinon.stub() };
|
const monitor = { _id: "123", save: sinon.stub() };
|
||||||
req.db.createMonitor.returns(monitor);
|
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]).to.be.an("error");
|
||||||
expect(next.firstCall.args[0].message).to.equal("Add Job 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 () => {
|
it("should return success message with data if all operations succeed", async () => {
|
||||||
const monitor = { _id: "123" };
|
const monitor = { _id: "123" };
|
||||||
req.db.getMonitorById.returns({ teamId: "123" });
|
req.db.getMonitorById.returns({ teamId: "123" });
|
||||||
|
|||||||
Reference in new issue
Block a user