Skip to content

Skip validations on mask#31

Merged
vitorcoxta merged 1 commit intomasterfrom
support/skip-validation-on-mask
Mar 10, 2026
Merged

Skip validations on mask#31
vitorcoxta merged 1 commit intomasterfrom
support/skip-validation-on-mask

Conversation

@KevinUphold
Copy link
Contributor

PR removes validations for EU TIN before masking, users should suppose to validate a TIN before masking.

https://uphold.atlassian.net/browse/BKO-6564

Copilot AI review requested due to automatic review settings March 5, 2026 15:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 threading skipExternalValidations through 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 mock euTinValidator.isValid() and pass { country, entityType } into mask(), but EUTinValidator.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 unused isValid spy/options and add an assertion that isValid is not called during mask().
    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.

@vitorcoxta
Copy link
Contributor

@KevinUphold this is not the intended.
What we intend here is to keep having support for skipExternalValidations, and to add support for skipValidations. And then update the IS calls to use skipValidations

@KevinUphold KevinUphold force-pushed the support/skip-validation-on-mask branch from 3da4e4a to 288a748 Compare March 6, 2026 15:45
Copy link
Contributor

@vitorcoxta vitorcoxta left a comment

Choose a reason for hiding this comment

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

LGTM to be deployed in backoffice and moved to QA

Copy link
Contributor

@vitorcoxta vitorcoxta left a comment

Choose a reason for hiding this comment

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

Please update README

@KevinUphold KevinUphold force-pushed the support/skip-validation-on-mask branch from 288a748 to 1e46c4e Compare March 6, 2026 16:09
Copy link

@antoniogferreira antoniogferreira left a comment

Choose a reason for hiding this comment

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

LGTM!

@antoniogferreira antoniogferreira added the QA Approved Approved by QA Team label Mar 10, 2026
Copy link
Contributor

@vitorcoxta vitorcoxta left a comment

Choose a reason for hiding this comment

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

LGTM!

@vitorcoxta vitorcoxta merged commit bc53bf1 into master Mar 10, 2026
8 checks passed
@vitorcoxta vitorcoxta deleted the support/skip-validation-on-mask branch March 10, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Approved Approved by QA Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants