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';
const tag = 'provinceFk';
try {
@ -20,7 +20,7 @@ fdescribe('Value is not', () => {
expect(valueIsNot.message(i18n, tag)).toEqual('El campo \'Provincia\' no es válido');
const data = {
method: 'POST',
originalUrl: 'updateFiscalData',
originalUrl: '/api/updateFiscalData',
body: {
[tag]: null
}
@ -34,11 +34,22 @@ fdescribe('Value is not', () => {
});
describe('OsTicket', () => {
let messageError = 'Value is not number';
let messageError = 'Value is not object';
const tag = 'additionalData';
it('sendToSupport endpoint', () => {
try {
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) {
expect(error).toBeDefined();
}