@@ -87,6 +87,25 @@ function assertBlankPageVisible(container) {
87
87
assertNotNull ( dom . getElementByClass ( 'firebaseui-id-page-blank' , container ) ) ;
88
88
}
89
89
90
+ /**
91
+ * Asserts the IdP or tenant button has correct labels.
92
+ * @param {!Element } button The IdP or tenant button.
93
+ * @param {string } expectedShortLabel The expected short label of the button.
94
+ * @param {string } expectedLongLabel The expected long label of the button.
95
+ */
96
+ function assertIdpButtonLabels ( button , expectedShortLabel , expectedLongLabel ) {
97
+ const idpTextLong = dom . getElementsByClass (
98
+ 'firebaseui-idp-text-long' , button ) ;
99
+ const idpTextShort = dom . getElementsByClass (
100
+ 'firebaseui-idp-text-short' , button ) ;
101
+
102
+ assertEquals (
103
+ expectedLongLabel ,
104
+ dom . getTextContent ( idpTextLong [ 0 ] ) ) ;
105
+ assertEquals (
106
+ expectedShortLabel ,
107
+ dom . getTextContent ( idpTextShort [ 0 ] ) ) ;
108
+ }
90
109
91
110
/**
92
111
* Asserts the busy indicator is after a short delay.
@@ -374,6 +393,7 @@ testSuite({
374
393
'tenants' : {
375
394
// The top-level project UI configuration.
376
395
'_' : {
396
+ 'fullLabel' : 'ACME Login' ,
377
397
'displayName' : 'ACME' ,
378
398
'buttonColor' : '#FFB6C1' ,
379
399
'iconUrl' : '<icon-url-of-sign-in-button>' ,
@@ -393,6 +413,7 @@ testSuite({
393
413
'privacyPolicyUrl' : 'http://localhost/privacy_policy' ,
394
414
} ,
395
415
'tenant1' : {
416
+ 'fullLabel' : 'Contractor A Portal' ,
396
417
'displayName' : 'Contractor A' ,
397
418
'buttonColor' : '#ADF7B2' ,
398
419
'iconUrl' : '<icon-url-of-sign-in-button>' ,
@@ -420,6 +441,7 @@ testSuite({
420
441
'privacyPolicyUrl' : 'http://localhost/privacy_policy' ,
421
442
} ,
422
443
'tenant2' : {
444
+ 'fullLabel' : 'Contractor B Portal' ,
423
445
'displayName' : 'Contractor B' ,
424
446
'buttonColor' : '#EAC9A1' ,
425
447
'iconUrl' : '<icon-url-of-sign-in-button>' ,
@@ -490,10 +512,20 @@ testSuite({
490
512
'firebaseui-id-tenant-selection-button' , container ) ;
491
513
// Two tenants should be available to be selected from.
492
514
const expectedTenants = [ 'tenant1' , 'tenant2' ] ;
515
+ // Two expected labels on buttons.
516
+ const expectedLongLabels = [
517
+ 'Contractor A Portal' ,
518
+ 'Sign in to Contractor B'
519
+ ] ;
520
+ const expectedShortLabels = [ 'Contractor A' , 'Contractor B' ] ;
521
+
493
522
assertEquals ( expectedTenants . length , buttons . length ) ;
494
523
for ( let i = 0 ; i < buttons . length ; i ++ ) {
495
- assertEquals ( expectedTenants [ i ] ,
496
- dataset . get ( buttons [ i ] , 'tenantId' ) ) ;
524
+ assertEquals ( expectedTenants [ i ] , dataset . get ( buttons [ i ] , 'tenantId' ) ) ;
525
+ assertIdpButtonLabels (
526
+ buttons [ i ] ,
527
+ expectedShortLabels [ i ] ,
528
+ expectedLongLabels [ i ] ) ;
497
529
}
498
530
499
531
// Click the tenant1's button.
@@ -587,10 +619,19 @@ testSuite({
587
619
'firebaseui-id-tenant-selection-button' , container ) ;
588
620
// Only two tenants should be available to be selected from.
589
621
const expectedTenants = [ 'tenant1' , 'tenant2' ] ;
622
+ const expectedLongLabels = [
623
+ 'Contractor A Portal' ,
624
+ 'Sign in to Contractor B'
625
+ ] ;
626
+ const expectedShortLabels = [ 'Contractor A' , 'Contractor B' ] ;
590
627
assertEquals ( expectedTenants . length , buttons . length ) ;
591
628
for ( let i = 0 ; i < buttons . length ; i ++ ) {
592
629
assertEquals ( expectedTenants [ i ] ,
593
- dataset . get ( buttons [ i ] , 'tenantId' ) ) ;
630
+ dataset . get ( buttons [ i ] , 'tenantId' ) ) ;
631
+ assertIdpButtonLabels (
632
+ buttons [ i ] ,
633
+ expectedShortLabels [ i ] ,
634
+ expectedLongLabels [ i ] ) ;
594
635
}
595
636
596
637
testingEvents . fireClickSequence ( buttons [ 1 ] ) ;
0 commit comments