2018-08-10 15:17:53 +00:00
|
|
|
const app = require(`${servicesDir}/ticket/server/server`);
|
|
|
|
|
2018-08-10 15:18:21 +00:00
|
|
|
describe('ticket deleted()', () => {
|
2018-09-13 12:29:59 +00:00
|
|
|
let ticket;
|
|
|
|
afterAll(async() => {
|
|
|
|
ticket.isDeleted = 0;
|
|
|
|
await app.models.Ticket.upsert(ticket);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('YOU should work this out', async() => {
|
|
|
|
ticket = await app.models.Ticket.findOne({where: {id: 1}});
|
|
|
|
|
|
|
|
expect(ticket.isDeleted).toEqual(false);
|
2018-08-10 15:17:53 +00:00
|
|
|
|
|
|
|
await app.models.Ticket.deleted({id: 1});
|
|
|
|
|
2018-09-13 12:29:59 +00:00
|
|
|
let deletedTicket = await app.models.Ticket.findOne({where: {id: 1}, fields: ['isDeleted']});
|
|
|
|
|
|
|
|
expect(deletedTicket.isDeleted).toEqual(true);
|
2018-08-10 15:17:53 +00:00
|
|
|
});
|
|
|
|
});
|