Skip to content

Commit

Permalink
suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-mira committed Mar 15, 2023
1 parent cad6d1f commit b1a4dab
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
checkMaxLength, isEncoded, checkValidNrrFormat, checkRoundToNearest, checkIgnoredParameter,
isReserved, isPositive, checkBlKey, checkCorrectType, checkOtValidValue, checkSfValidValue,
checkPRValue,
checkPrValue,
checkVValue,
checkStValidValue, checkSidIsPresent,
} from './validatorFunctions.js';
Expand Down Expand Up @@ -61,7 +61,7 @@ const keyValValidator = (cmcdJson, errors, warnings, warningFlag = true) => {
break;
case 'pr':
if(warningFlag) {
checkPRValue(cmcdJson, warnings, key, keyValue);
checkPrValue(cmcdJson, warnings, key, keyValue);
}
break;
case 'v':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ export const checkStValidValue = (errors, key, value) => {
checkValidValue(errors, key, value, ['v', 'l']);
};

export const checkPRValue = (cmcdJson, warnings, key, value) => {
if ((key === 'pr') && value === 1) {
export const checkPrValue = (cmcdJson, warnings, key, value) => {
if (key === 'pr' && value === 1) {
warnings.push(createWarning(warningTypes.valuePR, key, value));
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ export const jsonTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -417,7 +417,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -454,7 +454,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -498,7 +498,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -535,7 +535,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -572,7 +572,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -609,7 +609,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -652,7 +652,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -697,7 +697,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -742,7 +742,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -786,7 +786,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
},
],
parsedData: {
Expand Down Expand Up @@ -831,7 +831,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -883,7 +883,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -927,7 +927,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -971,7 +971,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -1050,7 +1050,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -1088,7 +1088,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -1126,7 +1126,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -1164,7 +1164,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -1209,7 +1209,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -1247,7 +1247,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -1285,7 +1285,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -1331,7 +1331,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down Expand Up @@ -1442,7 +1442,7 @@ export const queryTestCases = [
type: 'pr-value',
key: 'pr',
value: 1,
description: 'SHOULD only be sent if not equal to 1.'
description: 'SHOULD only be sent if not equal to 1.xx'
}
],
parsedData: {
Expand Down
2 changes: 1 addition & 1 deletion packages/cmcd-validator-library/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const warningTypes = {

export const warningDescription = {
noAlphabeticalOrder: 'Keys are not arranged alphabetically',
valuePR: 'SHOULD only be sent if not equal to 1.',
valuePR: 'SHOULD only be sent if not equal to 1.xx',
valueV: 'Client SHOULD omit this field if the version is 1',
noSidReceived: 'No sid received from CMCD message',
blWithWrongOtValue: 'bl key should only be sent with an object type of a, v or av',
Expand Down

0 comments on commit b1a4dab

Please sign in to comment.