@@ -69,6 +69,33 @@ func TestUserManagement(t *testing.T) {
69
69
}
70
70
}
71
71
72
+ func TestGetNonExistingUser (t * testing.T ) {
73
+ user , err := client .GetUser (context .Background (), "non.existing" )
74
+ if user != nil || ! auth .IsUserNotFound (err ) {
75
+ t .Errorf ("GetUser(non.existing) = (%v, %v); want = (nil, error)" , user , err )
76
+ }
77
+
78
+ user ,
err = client .
GetUserByEmail (
context .
Background (),
"[email protected] " )
79
+ if user != nil || ! auth .IsUserNotFound (err ) {
80
+ t .Errorf ("GetUserByEmail(non.existing) = (%v, %v); want = (nil, error)" , user , err )
81
+ }
82
+ }
83
+
84
+ func TestUpdateNonExistingUser (t * testing.T ) {
85
+ update := (
& auth.
UserToUpdate {}).
Email (
"[email protected] " )
86
+ user , err := client .UpdateUser (context .Background (), "non.existing" , update )
87
+ if user != nil || ! auth .IsUserNotFound (err ) {
88
+ t .Errorf ("UpdateUser(non.existing) = (%v, %v); want = (nil, error)" , user , err )
89
+ }
90
+ }
91
+
92
+ func TestDeleteNonExistingUser (t * testing.T ) {
93
+ err := client .DeleteUser (context .Background (), "non.existing" )
94
+ if ! auth .IsUserNotFound (err ) {
95
+ t .Errorf ("DeleteUser(non.existing) = %v; want = error" , err )
96
+ }
97
+ }
98
+
72
99
// N.B if the tests are failing due to inability to create existing users, manual
73
100
// cleanup of the previus test run might be required, delete the unwanted users via:
74
101
// https://console.firebase.google.com/u/0/project/<project-id>/authentication/users
0 commit comments