UNPKG

@omegabigdata/honoplay-api-helper-node

Version:
42 lines (35 loc) 1.38 kB
const should = require("should"); const sinon = require("sinon"); const app = require("../index").WorkingStatus; describe("# Working Status", () => { describe("- putWorkingStatus", () => { it("should Put WorkingStatus workingStatus Model mandatory", () => { should(() => app.putWorkingStatus()).throwError("Missing Parameters"); }); it("should method called success callback", () => { let success = sinon.spy(); app.putWorkingStatus({}, success, () => {}); should(success.called).be.true; }); it("should method called error callback when throw error", () => { let error = sinon.spy(); app.putWorkingStatus({}, () => {}, error); should(error.called).be.true; }); }); describe("- postWorkingStatus", () => { it("should Post WorkingStatus workingStatus Model mandatory", () => { should(() => app.postWorkingStatus()).throwError("Missing Parameters"); }); it("should method called success callback", () => { let success = sinon.spy(); app.postWorkingStatus({}, success, () => {}); should(success.called).be.true; }); it("should method called error callback when throw error", () => { let error = sinon.spy(); app.postWorkingStatus({}, () => {}, error); should(error.called).be.true; }); }); });