greuge backend unit tests for filter and totalGreuge finished
This commit is contained in:
parent
a60d8f120c
commit
072f02aacb
|
@ -2,8 +2,6 @@ import app from '../../../../server/server';
|
|||
import {catchErrors} from '../../../../../../services/utils/jasmineHelpers';
|
||||
import {restoreFixtures} from '../../../../../../services/db/testing_fixtures';
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
|
||||
describe('Client Create()', () => {
|
||||
beforeEach(() => {
|
||||
restoreFixtures();
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import filter from '../filter';
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
|
||||
describe('Greuge filter', () => {
|
||||
it('should call the filterParams method', () => {
|
||||
let params = {
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
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);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue