diff --git a/services/loopback/common/methods/ticket/specs/getSalespersonMana.spec.js b/services/loopback/common/methods/ticket/specs/getSalespersonMana.spec.js new file mode 100644 index 000000000..c804ec592 --- /dev/null +++ b/services/loopback/common/methods/ticket/specs/getSalespersonMana.spec.js @@ -0,0 +1,15 @@ +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(330); + }); + + it('should return 0 if the given ticket does not exists', async() => { + let mana = await app.models.Ticket.getSalesPersonMana(20); + + expect(mana).toEqual(0); + }); +});