Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
Juan 2018-09-13 15:33:35 +02:00
commit 7933607dd0
1 changed files with 6 additions and 3 deletions

View File

@ -8,12 +8,15 @@ describe('ticket deleted()', () => {
await app.models.TicketTracking.create({ticketFk: ticket.id, stateFk: 3}); await app.models.TicketTracking.create({ticketFk: ticket.id, stateFk: 3});
}); });
it('should change the state of a ticket to deleted, and set the property isDeleted true', async() => { it('should make the ticket is not deleted yet', async() => {
ticket = await app.models.Ticket.findOne({where: {id: 1}}); ticket = await app.models.Ticket.findOne({where: {id: 1}});
expect(ticket.isDeleted).toEqual(false); expect(ticket.isDeleted).toEqual(false);
ctx = {req: {accessToken: {userId: 9}}}; });
params = {id: 1};
it('should set a ticket to deleted and log the change on TicketState table', async() => {
let ctx = {req: {accessToken: {userId: 9}}};
let params = {id: 1};
await app.models.Ticket.deleted(ctx, params); await app.models.Ticket.deleted(ctx, params);
let deletedTicket = await app.models.Ticket.findOne({where: {id: 1}, fields: ['isDeleted']}); let deletedTicket = await app.models.Ticket.findOne({where: {id: 1}, fields: ['isDeleted']});