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

23 lines
679 B
JavaScript

const app = require(`${servicesDir}/ticket/server/server`);
// #651 Al borrar un ticket no se cambia su estado a eliminado
xdescribe('ticket deleted()', () => {
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);
await app.models.Ticket.deleted({id: 1});
let deletedTicket = await app.models.Ticket.findOne({where: {id: 1}, fields: ['isDeleted']});
expect(deletedTicket.isDeleted).toEqual(true);
});
});