salix/services/loopback/common/methods/ticket/specs/deleted.spec.js

16 lines
574 B
JavaScript

const app = require(`${servicesDir}/ticket/server/server`);
fdescribe('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);
});
});