17 lines
504 B
JavaScript
17 lines
504 B
JavaScript
|
import totalGreuge from '../totalGreuge';
|
||
|
|
||
|
describe('Greuge filter', () => {
|
||
|
it('should call the sumAmount method', done => {
|
||
|
let clientFk = 1;
|
||
|
let self = jasmine.createSpyObj('self', ['remoteMethod', 'rawSql']);
|
||
|
self.rawSql.and.returnValue(Promise.resolve([{sumAmount: 6000}]));
|
||
|
totalGreuge(self);
|
||
|
|
||
|
let callback = (err, result) => {
|
||
|
expect(result).toBe(6000);
|
||
|
done();
|
||
|
};
|
||
|
self.sumAmount(clientFk, callback);
|
||
|
});
|
||
|
});
|