Bug #651 test
This commit is contained in:
parent
d39365b63b
commit
d60308f72b
|
@ -8,12 +8,15 @@ describe('ticket deleted()', () => {
|
|||
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}});
|
||||
|
||||
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);
|
||||
|
||||
let deletedTicket = await app.models.Ticket.findOne({where: {id: 1}, fields: ['isDeleted']});
|
||||
|
|
Loading…
Reference in New Issue