/ticket/getSalesPersonMana.js Backend unit tests

This commit is contained in:
gerard 2018-08-10 16:31:44 +02:00
parent 06a3f0b6bc
commit ac90bb3b18
1 changed files with 15 additions and 0 deletions

View File

@ -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);
});
});