Skip to content

Commit

Permalink
Update validator.test.js isMobilePhone.js fixing typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Manu024 committed Oct 1, 2023
1 parent dc27f06 commit 3f70cb8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const phones = {
'es-SV': /^(\+?503)?[67]\d{7}$/,
'es-UY': /^(\+598|0)9[1-9][\d]{6}$/,
'es-VE': /^(\+?58)?(2|4)\d{9}$/,
'es-PR': /^(787|939)-\d{3}-\d{4}$/,
'et-EE': /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,
'fa-IR': /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,
'fi-FI': /^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,
Expand Down Expand Up @@ -159,7 +160,6 @@ const phones = {
'ar-YE': /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,
'ar-EH': /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,
'fa-AF': /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/,
'es-PR': /^(787|939)-\d{3}-\d{4}$/,
};
/* eslint-enable max-len */

Expand Down
28 changes: 14 additions & 14 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6081,20 +6081,6 @@ describe('Validators', () => {
'336000842',
],
},
{
locale: 'es-PR', // Puerto Rican locale
valid: [
'787-555-1234',
'939-555-5678',
],
invalid: [
'58563',
'787-555-12345',
'939-555-56789',
'787-5555-1234',
'939-5555-5678',
],
},
];

let allValid = [];
Expand Down Expand Up @@ -8772,6 +8758,20 @@ describe('Validators', () => {
'',
],
},
{
locale: 'es-PR', // Puerto Rican locale
valid: [
'787-555-1234',
'939-555-5678',
],
invalid: [
'58563',
'787-555-12345',
'939-555-56789',
'787-5555-1234',
'939-5555-5678',
],
},
{
locale: 'et-EE',
valid: [
Expand Down

0 comments on commit 3f70cb8

Please sign in to comment.