salix/services/loopback/common/methods/ticket/specs/getTotal.spec.js

18 lines
572 B
JavaScript

const app = require(`${servicesDir}/ticket/server/server`);
describe('ticket getTotal()', () => {
it('should call the getTotal method and return the response', async() => {
await app.models.Ticket.getTotal(1)
.then(response => {
expect(response).toEqual(448.25);
});
});
it(`should call the getTotal method and return zero if doesn't have lines`, async() => {
await app.models.Ticket.getTotal(13)
.then(response => {
expect(response).toEqual(0);
});
});
});