@@ -44,8 +44,7 @@ var testUser = &UserRecord{
4444 PhotoURL : "http://www.example.com/testuser/photo.png" ,
4545 ProviderID : defaultProviderID ,
4646 },
47- Disabled : false ,
48-
47+ Disabled : false ,
4948 EmailVerified : true ,
5049 ProviderUserInfo : []* UserInfo {
5150 {
@@ -71,7 +70,7 @@ var testUser = &UserRecord{
7170 EnrolledFactors : []* MultiFactorInfo {
7271 {
7372 UID : "0aaded3f-5e73-461d-aef9-37b48e3769be" ,
74- FactorID : Phone ,
73+ FactorID : "phone" ,
7574 EnrollmentTimestamp : 1614776780000 ,
7675 PhoneNumber : "+1234567890" ,
7776 DisplayName : "My MFA Phone" ,
@@ -80,7 +79,6 @@ var testUser = &UserRecord{
8079 },
8180}
8281
83- var emptyFactors []* MultiFactorInfo
8482var testUserWithoutMFA = & UserRecord {
8583 UserInfo : & UserInfo {
8684 UID : "testusernomfa" ,
@@ -90,8 +88,7 @@ var testUserWithoutMFA = &UserRecord{
9088 PhotoURL : "http://www.example.com/testusernomfa/photo.png" ,
9189 ProviderID : defaultProviderID ,
9290 },
93- Disabled : false ,
94-
91+ Disabled : false ,
9592 EmailVerified : true ,
9693 ProviderUserInfo : []* UserInfo {
9794 {
@@ -113,9 +110,7 @@ var testUserWithoutMFA = &UserRecord{
113110 },
114111 CustomClaims : map [string ]interface {}{"admin" : true , "package" : "gold" },
115112 TenantID : "testTenant" ,
116- MultiFactor : & MultiFactorSettings {
117- EnrolledFactors : emptyFactors ,
118- },
113+ MultiFactor : & MultiFactorSettings {},
119114}
120115
121116func TestGetUser (t * testing.T ) {
@@ -1677,6 +1672,22 @@ func TestMakeExportedUser(t *testing.T) {
16771672 }
16781673}
16791674
1675+ func TestUnsupportedAuthFactor (t * testing.T ) {
1676+ queryResponse := & userQueryResponse {
1677+ UID : "uid1" ,
1678+ MFAInfo : []* multiFactorInfoResponse {
1679+ {
1680+ MFAEnrollmentID : "enrollementId" ,
1681+ },
1682+ },
1683+ }
1684+
1685+ exported , err := queryResponse .makeExportedUserRecord ()
1686+ if exported != nil || err == nil {
1687+ t .Errorf ("makeExportedUserRecord() = (%v, %v); want = (nil, error)" , exported , err )
1688+ }
1689+ }
1690+
16801691func TestExportedUserRecordShouldClearRedacted (t * testing.T ) {
16811692 queryResponse := & userQueryResponse {
16821693 UID : "uid1" ,
0 commit comments