231801_test_to_master #1519
|
@ -38,7 +38,7 @@ describe('Supplier fiscal data path', () => {
|
||||||
await page.waitToClick(selectors.supplierFiscalData.saveButton);
|
await page.waitToClick(selectors.supplierFiscalData.saveButton);
|
||||||
const message = await page.waitForSnackbar();
|
const message = await page.waitForSnackbar();
|
||||||
|
|
||||||
expect(message.text).toContain('Data saved!');
|
expect(message.text).toContain('Invalid Tax number');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should save the changes as the tax number is valid this time', async() => {
|
it('should save the changes as the tax number is valid this time', async() => {
|
||||||
|
|
|
@ -278,5 +278,6 @@
|
||||||
"Added observation": "{{user}} añadió esta observacion: {{text}}",
|
"Added observation": "{{user}} añadió esta observacion: {{text}}",
|
||||||
"Comment added to client": "Observación añadida al cliente {{clientFk}}",
|
"Comment added to client": "Observación añadida al cliente {{clientFk}}",
|
||||||
"Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen",
|
"Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen",
|
||||||
"The first two values are letters": "The first two values are letters"
|
"The first two values are letters": "The first two values are letters",
|
||||||
|
"NIF no valido por VIES": "NIF no valido por VIES"
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.validateAsync('nif', nifInvalid, {
|
Self.validateAsync('nif', nifInvalid, {
|
||||||
message: 'Invalid TIN'
|
message: 'NIF no valido por VIES'
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.validateAsync('nif', tinIsValid, {
|
Self.validateAsync('nif', tinIsValid, {
|
||||||
|
@ -61,21 +61,21 @@ module.exports = Self => {
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
// async function tinIsValid(err, done) {
|
async function tinIsValid(err, done) {
|
||||||
// if (!this.countryFk)
|
if (!this.countryFk)
|
||||||
// return done();
|
return done();
|
||||||
|
|
||||||
// const filter = {
|
const filter = {
|
||||||
// fields: ['code'],
|
fields: ['code'],
|
||||||
// where: {id: this.countryFk}
|
where: {id: this.countryFk}
|
||||||
// };
|
};
|
||||||
// const country = await Self.app.models.Country.findOne(filter);
|
const country = await Self.app.models.Country.findOne(filter);
|
||||||
// const code = country ? country.code.toLowerCase() : null;
|
const code = country ? country.code.toLowerCase() : null;
|
||||||
|
|
||||||
// if (!this.nif || !validateTin(this.nif, code))
|
if (!this.nif || !validateTin(this.nif, code))
|
||||||
// err();
|
err();
|
||||||
// done();
|
done();
|
||||||
// }
|
}
|
||||||
|
|
||||||
Self.validateAsync('nif', nifInvalid);
|
Self.validateAsync('nif', nifInvalid);
|
||||||
async function nifInvalid(err, done) {
|
async function nifInvalid(err, done) {
|
||||||
|
|
Loading…
Reference in New Issue