salix/services/loopback/common/methods/client/specs/activeSalesperson.spec.js

34 lines
983 B
JavaScript
Raw Normal View History

const app = require('../../../../../client/server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
describe('Client activeSalesPerson', () => {
it('should call the activeSalesPerson() method with limit of 1', done => {
let filter = {
limit: 1
};
let callback = (error, result) => {
if (error) return catchErrors(done)(error);
expect(result.length).toEqual(1);
done();
};
app.models.Client.activeSalesPerson(filter, callback);
});
2018-02-27 11:08:19 +00:00
it('should call the activeSalesPerson() method with no limit and receive all 10 salesPersons', done => {
let filter = {
};
let callback = (error, result) => {
if (error) return catchErrors(done)(error);
2018-02-27 11:08:19 +00:00
expect(result.length).toEqual(10);
done();
};
app.models.Client.activeSalesPerson(filter, callback);
});
});