@@ -20,6 +20,7 @@ describe('multi-factor modular', function () {
20
20
await Utils . sleep ( 50 ) ;
21
21
}
22
22
} ) ;
23
+
23
24
it ( 'has no multi-factor information if not enrolled' , async function ( ) {
24
25
await firebase . auth ( ) . signInWithEmailAndPassword ( TEST_EMAIL , TEST_PASS ) ;
25
26
const { multiFactor } = firebase . auth ( ) . currentUser ;
@@ -84,6 +85,7 @@ describe('multi-factor modular', function () {
84
85
new Error ( 'Multi-factor users need to handle an exception on sign-in' ) ,
85
86
) ;
86
87
} ) ;
88
+
87
89
it ( 'reports an error when providing an invalid sms code' , async function ( ) {
88
90
if ( device . getPlatform ( ) === 'ios' ) {
89
91
this . skip ( ) ;
@@ -130,6 +132,7 @@ describe('multi-factor modular', function () {
130
132
}
131
133
return Promise . reject ( ) ;
132
134
} ) ;
135
+
133
136
it ( 'reports an error when providing an invalid verification code' , async function ( ) {
134
137
if ( device . getPlatform ( ) === 'ios' ) {
135
138
this . skip ( ) ;
@@ -165,6 +168,7 @@ describe('multi-factor modular', function () {
165
168
}
166
169
return Promise . reject ( ) ;
167
170
} ) ;
171
+
168
172
it ( 'reports an error when using an unknown factor' , async function ( ) {
169
173
const { email, password } = await createUserWithMultiFactor ( ) ;
170
174
@@ -253,6 +257,7 @@ describe('multi-factor modular', function () {
253
257
}
254
258
return Promise . resolve ( ) ;
255
259
} ) ;
260
+
256
261
it ( 'can enroll new factor without display name' , async function ( ) {
257
262
if ( device . getPlatform ( ) === 'ios' ) {
258
263
this . skip ( ) ;
@@ -283,6 +288,7 @@ describe('multi-factor modular', function () {
283
288
}
284
289
return Promise . resolve ( ) ;
285
290
} ) ;
291
+
286
292
it ( 'can enroll multiple factors' , async function ( ) {
287
293
if ( device . getPlatform ( ) === 'ios' ) {
288
294
this . skip ( ) ;
@@ -314,6 +320,7 @@ describe('multi-factor modular', function () {
314
320
315
321
return Promise . resolve ( ) ;
316
322
} ) ;
323
+
317
324
it ( 'can not enroll the same factor twice' , async function ( ) {
318
325
this . skip ( ) ;
319
326
// This test should probably be implemented but doesn't work:
@@ -389,6 +396,7 @@ describe('multi-factor modular', function () {
389
396
}
390
397
return Promise . reject ( ) ;
391
398
} ) ;
399
+
392
400
it ( 'throws an error for unknown sessions' , async function ( ) {
393
401
const { email, password } = await createUserWithMultiFactor ( ) ;
394
402
let resolver = null ;
@@ -415,6 +423,7 @@ describe('multi-factor modular', function () {
415
423
}
416
424
return Promise . reject ( ) ;
417
425
} ) ;
426
+
418
427
it ( 'throws an error for unknown verification code' , async function ( ) {
419
428
const { email, password } = await createUserWithMultiFactor ( ) ;
420
429
@@ -482,6 +491,7 @@ describe('multi-factor modular', function () {
482
491
new Error ( 'Enrolling a second factor when using phone authentication is not supported.' ) ,
483
492
) ;
484
493
} ) ;
494
+
485
495
it ( 'can not enroll when phone number is missing + sign' , async function ( ) {
486
496
await createVerifiedUser ( '[email protected] ' , 'test123' ) ;
487
497
const multiFactorUser = firebase . auth ( ) . multiFactor ( firebase . auth ( ) . currentUser ) ;
@@ -516,6 +526,7 @@ describe('multi-factor modular', function () {
516
526
await Utils . sleep ( 50 ) ;
517
527
}
518
528
} ) ;
529
+
519
530
it ( 'has no multi-factor information if not enrolled' , async function ( ) {
520
531
const { signInWithEmailAndPassword, getAuth } = authModular ;
521
532
@@ -804,6 +815,7 @@ describe('multi-factor modular', function () {
804
815
}
805
816
return Promise . resolve ( ) ;
806
817
} ) ;
818
+
807
819
it ( 'can enroll new factor without display name' , async function ( ) {
808
820
if ( device . getPlatform ( ) === 'ios' ) {
809
821
this . skip ( ) ;
@@ -842,6 +854,7 @@ describe('multi-factor modular', function () {
842
854
}
843
855
return Promise . resolve ( ) ;
844
856
} ) ;
857
+
845
858
it ( 'can enroll multiple factors' , async function ( ) {
846
859
if ( device . getPlatform ( ) === 'ios' ) {
847
860
this . skip ( ) ;
@@ -881,6 +894,7 @@ describe('multi-factor modular', function () {
881
894
882
895
return Promise . resolve ( ) ;
883
896
} ) ;
897
+
884
898
it ( 'can not enroll the same factor twice' , async function ( ) {
885
899
this . skip ( ) ;
886
900
// This test should probably be implemented but doesn't work:
@@ -962,6 +976,7 @@ describe('multi-factor modular', function () {
962
976
}
963
977
return Promise . reject ( ) ;
964
978
} ) ;
979
+
965
980
it ( 'throws an error for unknown sessions' , async function ( ) {
966
981
const { getAuth, signInWithEmailAndPassword, getMultiFactorResolver } = authModular ;
967
982
@@ -994,6 +1009,7 @@ describe('multi-factor modular', function () {
994
1009
}
995
1010
return Promise . reject ( ) ;
996
1011
} ) ;
1012
+
997
1013
it ( 'throws an error for unknown verification code' , async function ( ) {
998
1014
const { getAuth, signInWithEmailAndPassword, getMultiFactorResolver } = authModular ;
999
1015
@@ -1075,6 +1091,7 @@ describe('multi-factor modular', function () {
1075
1091
new Error ( 'Enrolling a second factor when using phone authentication is not supported.' ) ,
1076
1092
) ;
1077
1093
} ) ;
1094
+
1078
1095
it ( 'can not enroll when phone number is missing + sign' , async function ( ) {
1079
1096
const { getAuth, multiFactor } = authModular ;
1080
1097
0 commit comments