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

Bug: isIdentityCard test cases #1321

Closed
parasg1999 opened this issue May 27, 2020 · 1 comment · Fixed by #1322
Closed

Bug: isIdentityCard test cases #1321

parasg1999 opened this issue May 27, 2020 · 1 comment · Fixed by #1322
Labels

Comments

@parasg1999
Copy link
Contributor

The fixtures array includes objects having format

{
  locale: string,
  valid: [],
  invalid: [],
}

Then all the valid and invalid arrays are combined as

// Test fixtures
fixtures.forEach((fixture) => {
  if (fixture.valid) allValid = allValid.concat(fixture.valid);
  if (fixture.invalid) allInvalid = allInvalid.concat(fixture.invalid);
  test({
    validator: 'isIdentityCard',
    valid: fixture.valid,
    invalid: fixture.invalid,
    args: [fixture.locale],
  });
});

The issue is that we should remove the allInvalid array since a card number invalid in one locale may be valid in some other locale.

Would be happy to make a PR :)

@profnandaa
Copy link
Member

Sure, please go ahead and make the PR, thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants