salix/services/client/common/methods/greuge/specs/sumAmount.spec.js

15 lines
450 B
JavaScript
Raw Normal View History

2018-01-31 12:40:26 +00:00
const totalGreuge = require('../sumAmount');
2018-01-19 12:07:03 +00:00
describe('Greuge totalGreuge()', () => {
it('should call the sumAmount method', async() => {
let clientFk = 1;
let self = jasmine.createSpyObj('self', ['remoteMethod', 'rawSql']);
self.rawSql.and.returnValue(Promise.resolve([{sumAmount: 6000}]));
totalGreuge(self);
let result = await self.sumAmount(clientFk);
expect(result).toBe(6000);
});
});