16 lines
573 B
JavaScript
16 lines
573 B
JavaScript
const app = require(`${servicesDir}/ticket/server/server`);
|
|
|
|
describe('ticket deleted()', () => {
|
|
it('should call the getShipped method', async() => {
|
|
let oldTicket = await app.models.Ticket.findOne({where: {id: 1}});
|
|
|
|
expect(oldTicket.isDeleted).toEqual(false);
|
|
await app.models.Ticket.deleted({id: 1});
|
|
let ticket = await app.models.Ticket.findOne({where: {id: 1}, fields: ['isDeleted']});
|
|
|
|
expect(ticket.isDeleted).toEqual(true);
|
|
oldTicket.isDeleted = 0;
|
|
await app.models.Ticket.upsert(oldTicket);
|
|
});
|
|
});
|