Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for missing phone number types #70

Merged
merged 3 commits into from
May 29, 2024
Merged

Conversation

cottonman132
Copy link
Contributor

This PR adds support for validation for the missing phone number types.

Newly supported phone types:

  • tollFree
  • premiumRate
  • sharedCost
  • presonalNumber
  • uan
  • pager
  • voiceMail

Merging this PR resolves #68

Copy link
Owner

@cedvdb cedvdb left a comment

Choose a reason for hiding this comment

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

Thanks, Simpler than expected. Tests are needed to test the new types though

isTrue,
);

expect(
Copy link
Owner

@cedvdb cedvdb May 29, 2024

Choose a reason for hiding this comment

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

To cover more surface it would be nice to add a negative tests somewhere too. Something like:

        expect(
          Validator.validateWithLength(
            isoCode,
            examples.pager,     // assuming the pager example is not a valid mobile 
            PhoneNumberType.mobile,
          ),
          isFalse,
        );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, I'll add some

@cedvdb
Copy link
Owner

cedvdb commented May 29, 2024

Thanks for the PR and tests, very clean. Just one comment to resolve then we can ship this.

@cedvdb cedvdb merged commit bd3afbe into cedvdb:main May 29, 2024
1 check passed
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.

Missing phone number types
2 participants