#751 removes.spec.js repairs

This commit is contained in:
Carlos Jimenez 2018-10-24 13:45:59 +02:00
parent ed80915120
commit f4add0942c
2 changed files with 7 additions and 9 deletions

View File

@ -7,4 +7,3 @@ describe('client getMana()', () => {
expect(result.mana).toEqual(151.33); expect(result.mana).toEqual(151.33);
}); });
}); });

View File

@ -1,14 +1,13 @@
const app = require(`${servicesDir}/ticket/server/server`); const app = require(`${servicesDir}/ticket/server/server`);
xdescribe('sale removes()', () => { describe('sale removes()', () => {
let sale; let sale;
let newsale;
beforeAll(async() => { beforeAll(async() => {
sale = await app.models.Sale.findOne({where: {id: 1}}); sale = await app.models.Sale.findOne({where: {id: 9}});
}); sale.id = null;
newsale = await app.models.Sale.create(sale);
afterAll(async() => {
await app.models.Sale.create(sale);
}); });
it('should throw an error if the ticket of the given sales is not editable', async() => { it('should throw an error if the ticket of the given sales is not editable', async() => {
@ -30,8 +29,8 @@ xdescribe('sale removes()', () => {
it('should delete the sales', async() => { it('should delete the sales', async() => {
let params = { let params = {
sales: [{id: 1, instance: 0}], sales: [{id: newsale.id, instance: 0}],
actualTicketFk: 1 actualTicketFk: 16
}; };
let res = await app.models.Sale.removes(params); let res = await app.models.Sale.removes(params);