34 lines
983 B
JavaScript
34 lines
983 B
JavaScript
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);
|
|
});
|
|
|
|
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);
|
|
|
|
expect(result.length).toEqual(10);
|
|
done();
|
|
};
|
|
|
|
app.models.Client.activeSalesPerson(filter, callback);
|
|
});
|
|
});
|