#7292 - createAddresUEEMember #2489
|
@ -51,7 +51,7 @@ describe('Client Add address path', () => {
|
||||||
await page.waitToClick(selectors.clientAddresses.saveButton);
|
await page.waitToClick(selectors.clientAddresses.saveButton);
|
||||||
const message = await page.waitForSnackbar();
|
const message = await page.waitForSnackbar();
|
||||||
|
|
||||||
expect(message.text).toContain('Incoterms is required for a non UEE member');
|
expect(message.text).toContain('Incoterms and Customs agent are required for a non UEE member');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should receive an error after clicking save button as customsAgent is empty`, async() => {
|
it(`should receive an error after clicking save button as customsAgent is empty`, async() => {
|
||||||
|
|
|
@ -227,5 +227,7 @@
|
||||||
"They're not your subordinate": "They're not your subordinate",
|
"They're not your subordinate": "They're not your subordinate",
|
||||||
"InvoiceIn is already booked": "InvoiceIn is already booked",
|
"InvoiceIn is already booked": "InvoiceIn is already booked",
|
||||||
"This workCenter is already assigned to this agency": "This workCenter is already assigned to this agency",
|
"This workCenter is already assigned to this agency": "This workCenter is already assigned to this agency",
|
||||||
"You can only have one PDA": "You can only have one PDA"
|
"You can only have one PDA": "You can only have one PDA",
|
||||||
|
"Incoterms and Customs agent are required for a non UEE member": "Incoterms and Customs agent are required for a non UEE member"
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -359,5 +359,6 @@
|
||||||
"It was not able to create the invoice": "No se pudo crear la factura",
|
"It was not able to create the invoice": "No se pudo crear la factura",
|
||||||
"ticketCommercial": "El ticket {{ ticket }} para el vendedor {{ salesMan }} está en preparación. (mensaje generado automáticamente)",
|
"ticketCommercial": "El ticket {{ ticket }} para el vendedor {{ salesMan }} está en preparación. (mensaje generado automáticamente)",
|
||||||
"This PDA is already assigned to another user": "Este PDA ya está asignado a otro usuario",
|
"This PDA is already assigned to another user": "Este PDA ya está asignado a otro usuario",
|
||||||
"You can only have one PDA": "Solo puedes tener un PDA"
|
"You can only have one PDA": "Solo puedes tener un PDA",
|
||||||
|
"Incoterms and Customs agent are required for a non UEE member": "Se requieren Incoterms y agente de aduanas para un no miembro de la UEE"
|
||||||
}
|
}
|
|
@ -92,11 +92,8 @@ module.exports = function(Self) {
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
const isUeeMember = province.country().isUeeMember;
|
const isUeeMember = province.country().isUeeMember;
|
||||||
if (!isUeeMember && !args.incotermsFk)
|
if (!isUeeMember && (!args.incotermsFk || !args.customsAgentFk))
|
||||||
throw new UserError(`Incoterms is required for a non UEE member`);
|
throw new UserError(`Incoterms and Customs agent are required for a non UEE member`);
|
||||||
|
|
||||||
if (!isUeeMember && !args.customsAgentFk)
|
|
||||||
throw new UserError(`Customs agent is required for a non UEE member`);
|
|
||||||
|
|
||||||
delete args.ctx; // Remove unwanted properties
|
delete args.ctx; // Remove unwanted properties
|
||||||
const newAddress = await models.Address.create(args, myOptions);
|
const newAddress = await models.Address.create(args, myOptions);
|
||||||
|
|
|
@ -50,7 +50,7 @@ describe('Address createAddress', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(error).toBeDefined();
|
expect(error).toBeDefined();
|
||||||
expect(error.message).toEqual('Incoterms is required for a non UEE member');
|
expect(error.message).toEqual('Incoterms and Customs agent are required for a non UEE member');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw a non uee member error if no customsAgent is defined', async() => {
|
it('should throw a non uee member error if no customsAgent is defined', async() => {
|
||||||
|
@ -81,7 +81,7 @@ describe('Address createAddress', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(error).toBeDefined();
|
expect(error).toBeDefined();
|
||||||
expect(error.message).toEqual('Customs agent is required for a non UEE member');
|
expect(error.message).toEqual('Incoterms and Customs agent are required for a non UEE member');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create a new address and set as a client default address', async() => {
|
it('should create a new address and set as a client default address', async() => {
|
||||||
|
|
Loading…
Reference in New Issue