Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes EU TIN masking to no longer perform (or depend on) EU TIN validation, aligning with the intent that callers validate a TIN before masking it (BKO-6564).
Changes:
- Remove
EUTinValidator.mask()validation/isValid()call and make it synchronous. - Update exported
mask()behavior to stop threadingskipExternalValidationsthrough the masking path. - Remove/adjust tests that asserted validation behavior during masking.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/validators/eu-tin-validator.js |
Removes validation from mask() and simplifies masking implementation. |
src/index.js |
Updates public mask() API to stop passing skipExternalValidations (and currently still passes unused options to EU mask). |
test/src/validators/eu-tin-validator.test.js |
Removes mask-validation tests; remaining mask tests still reflect the old mask(value, options) shape. |
test/src/index.test.js |
Removes the test that asserted skipExternalValidations passthrough for mask(). |
Comments suppressed due to low confidence (1)
test/src/validators/eu-tin-validator.test.js:202
- These
mask()tests still mockeuTinValidator.isValid()and pass{ country, entityType }intomask(), butEUTinValidator.mask()no longer uses validation or options. To align the tests with the new contract (and to lock in the PR’s intent), remove the unusedisValidspy/options and add an assertion thatisValidis not called duringmask().
it('should uppercase value', async () => {
vi.spyOn(euTinValidator, 'isValid').mockResolvedValue(true);
const maskedValue = await euTinValidator.mask('1234567ab', { country: 'IE', entityType: 'legal-entity' });
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
@KevinUphold this is not the intended. |
3da4e4a to
288a748
Compare
vitorcoxta
left a comment
There was a problem hiding this comment.
LGTM to be deployed in backoffice and moved to QA
288a748 to
1e46c4e
Compare
PR removes validations for EU TIN before masking, users should suppose to validate a TIN before masking.
https://uphold.atlassian.net/browse/BKO-6564