salix/services/loopback/common/methods/ticket/specs/get-total.spec.js

28 lines
727 B
JavaScript
Raw Normal View History

2018-04-17 12:49:55 +00:00
const getTotal = require('../get-total');
const model = {
remoteMethod: () => {}
};
let Loopback = require('../../../test-helpers/loopback');
Loopback.init(model);
2018-04-17 12:49:55 +00:00
Loopback.rawSql(model);
2018-04-17 12:49:55 +00:00
getTotal(model);
describe('ticket getTotal()', () => {
it('should call the getTotal method and return the response', done => {
model.getTotal(1)
.then(response => {
expect(response).toEqual(11.55);
done();
});
});
it(`should call the getTotal method and return zero if doesn't have lines`, done => {
model.getTotal(13)
.then(response => {
expect(response).toEqual(0);
done();
});
});
});