2018-02-02 15:24:22 +00:00
|
|
|
const app = require('../../../../../client/server/server');
|
2018-01-31 11:02:35 +00:00
|
|
|
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
|
2018-01-26 10:23:53 +00:00
|
|
|
|
|
|
|
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 => {
|
2018-01-26 10:23:53 +00:00
|
|
|
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);
|
2018-01-26 10:23:53 +00:00
|
|
|
done();
|
|
|
|
};
|
|
|
|
|
|
|
|
app.models.Client.activeSalesPerson(filter, callback);
|
|
|
|
});
|
|
|
|
});
|