Skip to content

Conversation

@trung-nh
Copy link
Contributor

@trung-nh trung-nh commented Dec 8, 2025

Changes

  • Add handlePaste function for numeric fields to prevent pasting exponent notations
  • Fix rules min, max, lessThan, moreThan
  • Add unit tests

Additional information

  • You may refer to this ticket

${"number"} | ${"notEquals"} | ${{ notEquals: 1 }} | ${2} | ${1}
${"number"} | ${"lessThan"} | ${{ lessThan: 1 }} | ${0} | ${1}
${"number"} | ${"moreThan"} | ${{ moreThan: 1 }} | ${2} | ${1}
${"number"} | ${"lessThan"} | ${{ lessThan: 0 }} | ${-1} | ${1}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test the extreme ranges

Suggested change
${"number"} | ${"lessThan"} | ${{ lessThan: 0 }} | ${-1} | ${1}
${"number"} | ${"lessThan"} | ${{ lessThan: 0 }} | ${-1} | ${0}

@trung-nh trung-nh requested a review from qroll December 8, 2025 09:49
@qroll
Copy link
Contributor

qroll commented Dec 9, 2025

note that you will also need to update the backend validator and apply the same changes: https://github.com/LifeSG/validation-schema-generator/blob/main/src/schema-generator/yup-helper.ts

@trung-nh
Copy link
Contributor Author

I have updated the backend validator here

@qroll qroll merged commit 9cddf2c into LifeSG:main Dec 10, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants