@@ -52,6 +52,16 @@ describe('<pf-tabs>', function() {
5252
5353 beforeEach ( updateComplete ) ;
5454
55+ it ( 'should show the first tab as selected in the accessibility tree' , async function ( ) {
56+ const snapshot = await a11ySnapshot ( ) ;
57+ const tabs = snapshot . children ?. filter ( x => x . role === 'tab' ) ?? [ ] ;
58+ const [ first , ...rest ] = tabs ;
59+ expect ( first ) . to . have . property ( 'selected' , true ) ;
60+ for ( const tab of rest ) {
61+ expect ( tab ) . to . not . have . property ( 'selected' , true ) ;
62+ }
63+ } ) ;
64+
5565 it ( 'should apply aria attributes on initialization' , function ( ) {
5666 const tabs = element . querySelectorAll ( 'pf-tab' ) ;
5767 const panels = element . querySelectorAll ( 'pf-tab-panel' ) ;
@@ -121,6 +131,15 @@ describe('<pf-tabs>', function() {
121131 it ( 'should hide previously active panel' , function ( ) {
122132 expect ( element . querySelector ( 'pf-tab-panel' ) ) . to . have . attribute ( 'hidden' ) ;
123133 } ) ;
134+
135+ it ( 'should show the second tab as selected in the accessibility tree' , async function ( ) {
136+ const snapshot = await a11ySnapshot ( ) ;
137+ const tabs = snapshot . children ?. filter ( x => x . role === 'tab' ) ?? [ ] ;
138+ const [ first , second , third ] = tabs ;
139+ expect ( first ) . to . not . have . property ( 'selected' , true ) ;
140+ expect ( second ) . to . have . property ( 'selected' , true ) ;
141+ expect ( third ) . to . not . have . property ( 'selected' , true ) ;
142+ } ) ;
124143 } ) ;
125144
126145 describe ( 'setting `activeIndex` to 2' , function ( ) {
0 commit comments