refs #5878 test: update test

This commit is contained in:
Javier Segarra 2023-12-21 13:06:32 +01:00
parent d864dfd899
commit ec9e1e6d43
1 changed files with 15 additions and 4 deletions

View File

@ -12,7 +12,7 @@ fdescribe('Value is not', () => {
} }
}; };
it('UpdateFiscalData endpoint', () => { fit('UpdateFiscalData endpoint', () => {
let messageError = 'Value is not number'; let messageError = 'Value is not number';
const tag = 'provinceFk'; const tag = 'provinceFk';
try { try {
@ -20,7 +20,7 @@ fdescribe('Value is not', () => {
expect(valueIsNot.message(i18n, tag)).toEqual('El campo \'Provincia\' no es válido'); expect(valueIsNot.message(i18n, tag)).toEqual('El campo \'Provincia\' no es válido');
const data = { const data = {
method: 'POST', method: 'POST',
originalUrl: 'updateFiscalData', originalUrl: '/api/updateFiscalData',
body: { body: {
[tag]: null [tag]: null
} }
@ -34,11 +34,22 @@ fdescribe('Value is not', () => {
}); });
describe('OsTicket', () => { describe('OsTicket', () => {
let messageError = 'Value is not number'; let messageError = 'Value is not object';
const tag = 'additionalData';
it('sendToSupport endpoint', () => { it('sendToSupport endpoint', () => {
try { try {
expect(valueIsNot.validation(messageError)).toBeTrue(); expect(valueIsNot.validation(messageError)).toBeTrue();
expect(valueIsNot.message(ctx, 'provinceFk')).toEqual('El campo "Provincia" no es válido'); expect(valueIsNot.message(i18n, tag)).toEqual(`El campo '${tag}' no es válido`);
const data = {
method: 'POST',
originalUrl: '/api/OsTickets/send-to-support?access_token=DEFAULT_TOKEN',
body: {
[tag]: '{ \'foo\': 42 }'
}
};
const result = valueIsNot.handleError(data);
expect(result).toEqual(tag);
} catch (error) { } catch (error) {
expect(error).toBeDefined(); expect(error).toBeDefined();
} }