Skip to content

Commit

Permalink
fix: maximum years value interval for duration (#942)
Browse files Browse the repository at this point in the history
  • Loading branch information
QRuhier authored Feb 18, 2025
1 parent 07ae8a1 commit 0ff02dc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
12 changes: 0 additions & 12 deletions src/utils/validation/__snapshots__/validate.spec.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,6 @@ exports[`Special validation for duration > should validate have right rules for
],
"path": "responseFormat.SIMPLE.DURATION.mayears",
},
{
"errors": [
"Must be at least 0",
],
"path": "responseFormat.SIMPLE.DURATION.mayears",
},
{
"errors": [
"Must be at most 11",
],
"path": "responseFormat.SIMPLE.DURATION.mayears",
},
{
"errors": [
"Mandatory field",
Expand Down
2 changes: 0 additions & 2 deletions src/utils/validation/validation-rules.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ export const durationRulesPnYnM = {
],
[`${RESPONSE_FORMAT}.${SIMPLE}.${DURATION}.mayears`]: [
(value) => required(value),
(value) => minValue(0)(value),
(value) => maxValue(11)(value),
],
[`${RESPONSE_FORMAT}.${SIMPLE}.${DURATION}.miyears`]: [
(value) => required(value),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/validation/validation-rules.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('duration rules validation', () => {
expect(
durationRulesPnYnM[`${RESPONSE_FORMAT}.${SIMPLE}.${DURATION}.mayears`]
.length,
).toBe(3);
).toBe(1);
expect(
durationRulesPnYnM[`${RESPONSE_FORMAT}.${SIMPLE}.${DURATION}.miyears`]
.length,
Expand Down

0 comments on commit 0ff02dc

Please sign in to comment.