@@ -69,6 +69,7 @@ describe('ui-select tests', function() {
69
69
if ( attrs . theme !== undefined ) { attrsHtml += ' theme="' + attrs . theme + '"' ; }
70
70
if ( attrs . tabindex !== undefined ) { attrsHtml += ' tabindex="' + attrs . tabindex + '"' ; }
71
71
if ( attrs . tagging !== undefined ) { attrsHtml += ' tagging="' + attrs . tagging + '"' ; }
72
+ if ( attrs . title !== undefined ) { attrsHtml += ' title="' + attrs . title + '"' ; }
72
73
}
73
74
74
75
return compileTemplate (
@@ -1656,4 +1657,32 @@ describe('ui-select tests', function() {
1656
1657
} ) ;
1657
1658
1658
1659
} ) ;
1660
+
1661
+ describe ( 'accessibility' , function ( ) {
1662
+ it ( 'should have baseTitle in scope' , function ( ) {
1663
+ expect ( createUiSelect ( ) . scope ( ) . $select . baseTitle ) . toBe ( 'Select box' ) ;
1664
+ expect ( createUiSelect ( ) . scope ( ) . $select . focusserTitle ) . toBe ( 'Select box focus' ) ;
1665
+ expect ( createUiSelect ( { title : 'Choose a person' } ) . scope ( ) . $select . baseTitle ) . toBe ( 'Choose a person' ) ;
1666
+ expect ( createUiSelect ( { title : 'Choose a person' } ) . scope ( ) . $select . focusserTitle ) . toBe ( 'Choose a person focus' ) ;
1667
+ } ) ;
1668
+
1669
+ iit ( 'should have aria-label on all input and button elements' , function ( ) {
1670
+ checkTheme ( ) ;
1671
+ checkTheme ( 'select2' ) ;
1672
+ checkTheme ( 'selectize' ) ;
1673
+ checkTheme ( 'bootstrap' ) ;
1674
+
1675
+ function checkTheme ( theme ) {
1676
+ var el = createUiSelect ( { theme : theme } ) ;
1677
+ checkElements ( el . find ( 'input' ) ) ;
1678
+ checkElements ( el . find ( 'button' ) ) ;
1679
+
1680
+ function checkElements ( els ) {
1681
+ for ( var i = 0 ; i < els . length ; i ++ ) {
1682
+ expect ( els [ i ] . attributes [ 'aria-label' ] ) . toBeTruthy ( ) ;
1683
+ } ;
1684
+ }
1685
+ }
1686
+ } ) ;
1687
+ } ) ;
1659
1688
} ) ;
0 commit comments