22 lines
543 B
JavaScript
22 lines
543 B
JavaScript
const models = require('vn-loopback/server/server').models;
|
|
|
|
describe('Greuge totalGreuge()', () => {
|
|
it('should call the sumAmount method', async() => {
|
|
const tx = await models.Client.beginTransaction({});
|
|
|
|
try {
|
|
const options = {transaction: tx};
|
|
|
|
const clientId = 1;
|
|
|
|
const result = await models.Client.sumAmount(clientId, options);
|
|
|
|
expect(result).toBe(6000);
|
|
|
|
await tx.rollback();
|
|
} catch (e) {
|
|
await tx.rollback();
|
|
}
|
|
});
|
|
});
|