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

2fa: Update to use upstream phone package again #27902

Merged
merged 7 commits into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions client/lib/phone-validation/test/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ describe( 'Phone Validation Library', () => {
test( 'should pass a valid number', () => {
assert.strictEqual( phoneValidation( '+447941952721' ).info, 'phone_number_valid' );
} );
test( 'should pass a valid 10 digit argentine mobile number', () => {
assert.strictEqual( phoneValidation( '+541112345678' ).info, 'phone_number_valid' );
test( 'should fail an invalid 9-digit argentine number', () => {
assert.strictEqual( phoneValidation( '+54299123456' ).error, 'phone_number_invalid' );
} );
test( 'should pass a valid 10 digit argentine without leading 9 number', () => {
assert.strictEqual( phoneValidation( '+542231234567' ).info, 'phone_number_valid' );
} );
test( 'should pass a valid 10 digit argentine with leading 9 number', () => {
assert.strictEqual( phoneValidation( '+5492231234567' ).info, 'phone_number_valid' );
} );
test( 'should pass a valid 8-digit croatian number', () => {
assert.strictEqual( phoneValidation( '+38598123456' ).info, 'phone_number_valid' );
Expand All @@ -48,6 +54,9 @@ describe( 'Phone Validation Library', () => {
test( 'should pass a valid new format vietnamese number starting with 3', () => {
assert.strictEqual( phoneValidation( '+84361234567' ).info, 'phone_number_valid' );
} );
test( 'should pass a valid new format vietnamese number with leading zero', () => {
assert.strictEqual( phoneValidation( '+840361234567' ).info, 'phone_number_valid' );
} );
test( 'should pass a valid greenland number starting with 2', () => {
assert.strictEqual( phoneValidation( '+299239349' ).info, 'phone_number_valid' );
} );
Expand All @@ -63,4 +72,7 @@ describe( 'Phone Validation Library', () => {
test( 'should pass a valid myanmar number with 9 digits after leading 9', () => {
assert.strictEqual( phoneValidation( '+959426123456' ).info, 'phone_number_valid' );
} );
test( 'should pass a valid Brazilian number starting with 49', () => {
assert.strictEqual( phoneValidation( '+554912345678' ).info, 'phone_number_valid' );
} );
} );
152 changes: 123 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"page": "1.11.4",
"path-browserify": "1.0.0",
"percentage-regex": "3.0.0",
"phone": "git+https://github.com/Automattic/node-phone.git#v2.4.0-pre-1",
"phone": "2.4.2",
"photon": "file:./packages/photon",
"postcss-cli": "6.1.2",
"prismjs": "1.16.0",
Expand Down