3979-abonarTicketsSinAlmacen #1910
|
@ -2910,8 +2910,7 @@ INSERT INTO `vn`.`workerConfig` (`id`, `businessUpdated`, `roleFk`, `payMethodFk
|
||||||
|
|
||||||
INSERT INTO `vn`.`ticketRefund`(`refundTicketFk`, `originalTicketFk`)
|
INSERT INTO `vn`.`ticketRefund`(`refundTicketFk`, `originalTicketFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 12),
|
(24, 7);
|
||||||
(8, 10);
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`deviceProductionModels` (`code`)
|
INSERT INTO `vn`.`deviceProductionModels` (`code`)
|
||||||
VALUES
|
VALUES
|
||||||
|
|
|
@ -236,7 +236,7 @@ describe('Ticket Edit sale path', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show error trying to delete a ticket with a refund', async() => {
|
it('should show error trying to delete a ticket with a refund', async() => {
|
||||||
await page.accessToSearchResult('16');
|
await page.accessToSearchResult('6');
|
||||||
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
|
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
|
||||||
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket);
|
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket);
|
||||||
await page.waitToClick(selectors.globalItems.acceptButton);
|
await page.waitToClick(selectors.globalItems.acceptButton);
|
||||||
|
|
|
@ -67,16 +67,4 @@ describe('Ticket cloning - clone function', () => {
|
||||||
expect(services.length).toBeGreaterThan(0);
|
expect(services.length).toBeGreaterThan(0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle transaction rollback on error', async() => {
|
|
||||||
const negative = true;
|
|
||||||
const salesIds = [1, 2, 3, 4, 5];
|
|
||||||
const servicesIds = [];
|
|
||||||
try {
|
|
||||||
await models.Sale.clone(ctx, salesIds, servicesIds, false, negative, options);
|
|
||||||
fail('Expected error was not thrown');
|
|
||||||
} catch (error) {
|
|
||||||
expect(error).toBeDefined();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,6 @@ const LoopBackContext = require('loopback-context');
|
||||||
|
|
||||||
describe('ticket setDeleted()', () => {
|
describe('ticket setDeleted()', () => {
|
||||||
const userId = 1106;
|
const userId = 1106;
|
||||||
const employeeUser = 1110;
|
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: userId},
|
accessToken: {userId: userId},
|
||||||
};
|
};
|
||||||
|
@ -118,7 +117,7 @@ describe('ticket setDeleted()', () => {
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ticketId = 12;
|
const ticketId = 7;
|
||||||
await models.Ticket.setDeleted(ctx, ticketId, options);
|
await models.Ticket.setDeleted(ctx, ticketId, options);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
|
@ -132,7 +132,7 @@ describe('sale model ', () => {
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue(getActiveCtx(9));
|
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue(getActiveCtx(9));
|
||||||
|
|
||||||
const tx = await models.Sale.beginTransaction({});
|
const tx = await models.Sale.beginTransaction({});
|
||||||
const saleId = 13;
|
const saleId = 32;
|
||||||
const newQuantity = -10;
|
const newQuantity = -10;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue