fix e2e errors

This commit is contained in:
Bernat Exposito Domenech 2020-07-09 14:14:11 +02:00
parent c31825331d
commit 02c82f894a
4 changed files with 7 additions and 6 deletions

View File

@ -1,5 +0,0 @@
UPDATE `salix`.`ACL` SET `accessType`='WRITE' WHERE `id`='213';
UPDATE `salix`.`ACL` SET `property` = 'deleteSales' WHERE (`id` = '80');
INSERT IGNORE INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('CustomsAgent', '*', '*', 'ALLOW', 'ROLE', 'employee');

File diff suppressed because one or more lines are too long

View File

@ -211,12 +211,16 @@ describe('Ticket Edit sale path', () => {
it('should search for a ticket then access to the sales section', async() => {
await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale');
await page.wait(2000);
});
it('should select the third sale and delete it', async() => {
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
await page.wait(2000);
await page.waitToClick(selectors.ticketSales.deleteSaleButton);
await page.wait(2000);
await page.waitToClick(selectors.ticketSales.acceptDeleteLineButton);
await page.wait(2000);
await page.waitForSpinnerLoad();
const message = await page.waitForSnackbar();

View File

@ -22,6 +22,8 @@ module.exports = Self => {
async function claimIsEditable(ctx) {
const loopBackContext = LoopBackContext.getCurrentContext();
const httpCtx = {req: loopBackContext.active};
console.log(ctx, 'ctx.where.id');
console.log(ctx.where, 'ctx.where.id');
const isEditable = await Self.app.models.Claim.isEditable(httpCtx, ctx.where.id);
if (!isEditable)