2018-04-19 09:20:41 +00:00
|
|
|
const app = require(`${servicesDir}/ticket/server/server`);
|
2018-04-17 12:49:55 +00:00
|
|
|
|
|
|
|
describe('ticket getTotal()', () => {
|
|
|
|
it('should call the getTotal method and return the response', done => {
|
2018-04-19 09:20:41 +00:00
|
|
|
app.models.Ticket.getTotal(1)
|
2018-04-17 12:49:55 +00:00
|
|
|
.then(response => {
|
2018-07-02 06:18:54 +00:00
|
|
|
expect(response).toEqual(448.25);
|
2018-04-17 12:49:55 +00:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should call the getTotal method and return zero if doesn't have lines`, done => {
|
2018-04-19 09:20:41 +00:00
|
|
|
app.models.Ticket.getTotal(13)
|
2018-04-17 12:49:55 +00:00
|
|
|
.then(response => {
|
|
|
|
expect(response).toEqual(0);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|