This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +42
-1
lines changed
packages/firebase_auth/test Expand file tree Collapse file tree 1 file changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ void main() {
4040 return mockHandleId++ ;
4141 break ;
4242 case "sendPasswordResetEmail" :
43+ case "updateEmail" :
44+ case "updatePassword" :
4345 case "updateProfile" :
4446 return null ;
4547 break ;
@@ -336,13 +338,52 @@ void main() {
336338 );
337339 });
338340
341+ test ('updateEmail' , () async {
342+ final FirebaseUser user = await auth.currentUser ();
343+ await user.updateEmail (kMockEmail);
344+ expect (log, < Matcher > [
345+ isMethodCall (
346+ 'currentUser' ,
347+ arguments: null ,
348+ ),
349+ isMethodCall (
350+ 'updateEmail' ,
351+ arguments: < String , String > {
352+ 'email' : kMockEmail,
353+ },
354+ ),
355+ ]);
356+ });
357+
358+ test ('updatePassword' , () async {
359+ final FirebaseUser user = await auth.currentUser ();
360+ await user.updatePassword (kMockPassword);
361+ expect (log, < Matcher > [
362+ isMethodCall (
363+ 'currentUser' ,
364+ arguments: null ,
365+ ),
366+ isMethodCall (
367+ 'updatePassword' ,
368+ arguments: < String , String > {
369+ 'password' : kMockPassword,
370+ },
371+ ),
372+ ]);
373+ });
374+
339375 test ('updateProfile' , () async {
340376 final UserUpdateInfo userUpdateInfo = new UserUpdateInfo ();
341377 userUpdateInfo.photoUrl = kMockPhotoUrl;
342378 userUpdateInfo.displayName = kMockDisplayName;
343379
344- await auth.updateProfile (userUpdateInfo);
380+ final FirebaseUser user = await auth.currentUser ();
381+ await user.updateProfile (userUpdateInfo);
345382 expect (log, < Matcher > [
383+ isMethodCall (
384+ 'currentUser' ,
385+ arguments: null ,
386+ ),
346387 isMethodCall (
347388 'updateProfile' ,
348389 arguments: < String , String > {
You can’t perform that action at this time.
0 commit comments