@@ -1183,9 +1183,14 @@ describe('admin.auth', () => {
1183
1183
state : 'ENABLED' ,
1184
1184
factorIds : [ 'phone' ] ,
1185
1185
} ,
1186
- // Test phone numbers are ignored in auth emulator. For more information,
1187
- // please refer to this section of the auth emulator DD:
1188
- // go/firebase-auth-emulator-dd#heading=h.odk06so2ydjd
1186
+ // These test phone numbers will not be checked when running integration
1187
+ // tests against the emulator suite and are ignored in auth emulator
1188
+ // altogether. For more information, please refer to this section of the
1189
+ // auth emulator DD: go/firebase-auth-emulator-dd#heading=h.odk06so2ydjd
1190
+ testPhoneNumbers : {
1191
+ '+16505551234' : '019287' ,
1192
+ '+16505550676' : '985235' ,
1193
+ } ,
1189
1194
} ;
1190
1195
const expectedUpdatedTenant : any = {
1191
1196
displayName : 'testTenantUpdated' ,
@@ -1198,10 +1203,12 @@ describe('admin.auth', () => {
1198
1203
state : 'DISABLED' ,
1199
1204
factorIds : [ ] ,
1200
1205
} ,
1201
- // Though test phone numbers are ignored in the auth emulator,
1202
- // non-standard update behavior will still initialize this to an empty
1203
- // object.
1204
- testPhoneNumbers : { } ,
1206
+ // Test phone numbers will not be checked when running integration tests
1207
+ // against emulator suite. For more information, please refer to:
1208
+ // go/firebase-auth-emulator-dd#heading=h.odk06so2ydjd
1209
+ testPhoneNumbers : {
1210
+ '+16505551234' : '123456' ,
1211
+ } ,
1205
1212
} ;
1206
1213
const expectedUpdatedTenant2 : any = {
1207
1214
displayName : 'testTenantUpdated' ,
@@ -1214,10 +1221,6 @@ describe('admin.auth', () => {
1214
1221
state : 'ENABLED' ,
1215
1222
factorIds : [ 'phone' ] ,
1216
1223
} ,
1217
- // Though test phone numbers are ignored in the auth emulator,
1218
- // non-standard update behavior will still initialize this to an empty
1219
- // object.
1220
- testPhoneNumbers : { } ,
1221
1224
} ;
1222
1225
1223
1226
// https://mochajs.org/
@@ -1252,7 +1255,19 @@ describe('admin.auth', () => {
1252
1255
createdTenantId = actualTenant . tenantId ;
1253
1256
createdTenants . push ( createdTenantId ) ;
1254
1257
expectedCreatedTenant . tenantId = createdTenantId ;
1255
- expect ( actualTenant . toJSON ( ) ) . to . deep . equal ( expectedCreatedTenant ) ;
1258
+ const actualTenantObj = actualTenant . toJSON ( ) ;
1259
+ if ( authEmulatorHost ) {
1260
+ expect ( actualTenantObj ) . to . have . property ( 'displayName' )
1261
+ . eql ( expectedCreatedTenant . displayName ) ;
1262
+ expect ( actualTenantObj ) . to . have . property ( 'emailSignInConfig' )
1263
+ . eql ( expectedCreatedTenant . emailSignInConfig ) ;
1264
+ expect ( actualTenantObj ) . to . have . property ( 'anonymousSignInEnabled' )
1265
+ . eql ( expectedCreatedTenant . anonymousSignInEnabled ) ;
1266
+ expect ( actualTenantObj ) . to . have . property ( 'multiFactorConfig' )
1267
+ . eql ( expectedCreatedTenant . multiFactorConfig ) ;
1268
+ } else {
1269
+ expect ( actualTenantObj ) . to . deep . equal ( expectedCreatedTenant ) ;
1270
+ }
1256
1271
} ) ;
1257
1272
} ) ;
1258
1273
@@ -1494,8 +1509,11 @@ describe('admin.auth', () => {
1494
1509
}
1495
1510
} ) ;
1496
1511
1497
- // TODO(lisajian): Unskip once auth emulator supports OIDC/SAML
1498
- it . skip ( 'should support CRUD operations' , ( ) => {
1512
+ it ( 'should support CRUD operations' , function ( ) {
1513
+ // TODO(lisajian): Unskip once auth emulator supports OIDC/SAML
1514
+ if ( authEmulatorHost ) {
1515
+ return this . skip ( ) ; // Not yet supported in Auth Emulator.
1516
+ }
1499
1517
return tenantAwareAuth . createProviderConfig ( authProviderConfig )
1500
1518
. then ( ( config ) => {
1501
1519
assertDeepEqualUnordered ( authProviderConfig , config ) ;
@@ -1571,9 +1589,12 @@ describe('admin.auth', () => {
1571
1589
} ) ;
1572
1590
}
1573
1591
} ) ;
1574
-
1575
- // TODO(lisajian): Unskip once auth emulator supports OIDC/SAML
1576
- it . skip ( 'should support CRUD operations' , ( ) => {
1592
+
1593
+ it ( 'should support CRUD operations' , function ( ) {
1594
+ // TODO(lisajian): Unskip once auth emulator supports OIDC/SAML
1595
+ if ( authEmulatorHost ) {
1596
+ return this . skip ( ) ; // Not yet supported in Auth Emulator.
1597
+ }
1577
1598
return tenantAwareAuth . createProviderConfig ( authProviderConfig )
1578
1599
. then ( ( config ) => {
1579
1600
assertDeepEqualUnordered ( authProviderConfig , config ) ;
@@ -1598,7 +1619,19 @@ describe('admin.auth', () => {
1598
1619
it ( 'getTenant() should resolve with expected tenant' , ( ) => {
1599
1620
return getAuth ( ) . tenantManager ( ) . getTenant ( createdTenantId )
1600
1621
. then ( ( actualTenant ) => {
1601
- expect ( actualTenant . toJSON ( ) ) . to . deep . equal ( expectedCreatedTenant ) ;
1622
+ const actualTenantObj = actualTenant . toJSON ( ) ;
1623
+ if ( authEmulatorHost ) {
1624
+ expect ( actualTenantObj ) . to . have . property ( 'displayName' )
1625
+ . eql ( expectedCreatedTenant . displayName ) ;
1626
+ expect ( actualTenantObj ) . to . have . property ( 'emailSignInConfig' )
1627
+ . eql ( expectedCreatedTenant . emailSignInConfig ) ;
1628
+ expect ( actualTenantObj ) . to . have . property ( 'anonymousSignInEnabled' )
1629
+ . eql ( expectedCreatedTenant . anonymousSignInEnabled ) ;
1630
+ expect ( actualTenantObj ) . to . have . property ( 'multiFactorConfig' )
1631
+ . eql ( expectedCreatedTenant . multiFactorConfig ) ;
1632
+ } else {
1633
+ expect ( actualTenantObj ) . to . deep . equal ( expectedCreatedTenant ) ;
1634
+ }
1602
1635
} ) ;
1603
1636
} ) ;
1604
1637
@@ -1622,6 +1655,32 @@ describe('admin.auth', () => {
1622
1655
// Test clearing of phone numbers.
1623
1656
testPhoneNumbers : null ,
1624
1657
} ;
1658
+ if ( authEmulatorHost ) {
1659
+ return getAuth ( ) . tenantManager ( ) . updateTenant ( createdTenantId , updatedOptions )
1660
+ . then ( ( actualTenant ) => {
1661
+ const actualTenantObj = actualTenant . toJSON ( ) ;
1662
+ expect ( actualTenantObj ) . to . have . property ( 'displayName' )
1663
+ . eql ( expectedUpdatedTenant . displayName ) ;
1664
+ expect ( actualTenantObj ) . to . have . property ( 'emailSignInConfig' )
1665
+ . eql ( expectedUpdatedTenant . emailSignInConfig ) ;
1666
+ expect ( actualTenantObj ) . to . have . property ( 'anonymousSignInEnabled' )
1667
+ . eql ( expectedUpdatedTenant . anonymousSignInEnabled ) ;
1668
+ expect ( actualTenantObj ) . to . have . property ( 'multiFactorConfig' )
1669
+ . eql ( expectedUpdatedTenant . multiFactorConfig ) ;
1670
+ return getAuth ( ) . tenantManager ( ) . updateTenant ( createdTenantId , updatedOptions2 ) ;
1671
+ } )
1672
+ . then ( ( actualTenant ) => {
1673
+ const actualTenantObj = actualTenant . toJSON ( ) ;
1674
+ expect ( actualTenantObj ) . to . have . property ( 'displayName' )
1675
+ . eql ( expectedUpdatedTenant2 . displayName ) ;
1676
+ expect ( actualTenantObj ) . to . have . property ( 'emailSignInConfig' )
1677
+ . eql ( expectedUpdatedTenant2 . emailSignInConfig ) ;
1678
+ expect ( actualTenantObj ) . to . have . property ( 'anonymousSignInEnabled' )
1679
+ . eql ( expectedUpdatedTenant2 . anonymousSignInEnabled ) ;
1680
+ expect ( actualTenantObj ) . to . have . property ( 'multiFactorConfig' )
1681
+ . eql ( expectedUpdatedTenant2 . multiFactorConfig ) ;
1682
+ } ) ;
1683
+ }
1625
1684
return getAuth ( ) . tenantManager ( ) . updateTenant ( createdTenantId , updatedOptions )
1626
1685
. then ( ( actualTenant ) => {
1627
1686
expect ( actualTenant . toJSON ( ) ) . to . deep . equal ( expectedUpdatedTenant ) ;
0 commit comments