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

16 lines
486 B
JavaScript

const app = require(`${servicesDir}/ticket/server/server`);
describe('ticket getSalesPersonMana()', () => {
it('should get the mana of a salesperson of a given ticket', async() => {
let mana = await app.models.Ticket.getSalesPersonMana(1);
expect(mana).toEqual(470);
});
it('should return 0 if the given ticket does not exists', async() => {
let mana = await app.models.Ticket.getSalesPersonMana(20);
expect(mana).toEqual(0);
});
});