@@ -142,7 +142,27 @@ QUnit.module('PivotGrid markup tests', () => {
142142 }
143143 } ) ;
144144
145- QUnit . test ( 'Non-expandable td has neither aria-expanded nor tabindex' , function ( assert ) {
145+ QUnit . test ( 'Expandable td has role="button"' , function ( assert ) {
146+ if ( ! windowUtils . hasWindow ( ) ) {
147+ assert . ok ( true , 'skipped on serverSide' ) ;
148+ return ;
149+ }
150+ const clock = sinon . useFakeTimers ( ) ;
151+ try {
152+ const pivotGrid = createPivotGrid ( { dataSource : createExpandableDataSource ( ) } ) ;
153+ clock . tick ( 10 ) ;
154+
155+ const $expandedTd = pivotGrid . $element ( ) . find ( '.dx-pivotgrid-expanded' ) . first ( ) . closest ( 'td' ) ;
156+ const $collapsedTd = pivotGrid . $element ( ) . find ( '.dx-pivotgrid-collapsed' ) . first ( ) . closest ( 'td' ) ;
157+
158+ assert . strictEqual ( $expandedTd . attr ( 'role' ) , 'button' , 'expanded td has role="button"' ) ;
159+ assert . strictEqual ( $collapsedTd . attr ( 'role' ) , 'button' , 'collapsed td has role="button"' ) ;
160+ } finally {
161+ clock . restore ( ) ;
162+ }
163+ } ) ;
164+
165+ QUnit . test ( 'Non-expandable td has no role, aria-expanded, or tabindex' , function ( assert ) {
146166 if ( ! windowUtils . hasWindow ( ) ) {
147167 assert . ok ( true , 'skipped on serverSide' ) ;
148168 return ;
@@ -155,6 +175,7 @@ QUnit.module('PivotGrid markup tests', () => {
155175 const $nonExpandableTd = pivotGrid . $element ( ) . find ( 'td:not([aria-expanded])' ) . first ( ) ;
156176
157177 assert . ok ( $nonExpandableTd . length > 0 , 'non-expandable td exists' ) ;
178+ assert . strictEqual ( $nonExpandableTd . attr ( 'role' ) , undefined , 'no role attribute' ) ;
158179 assert . strictEqual ( $nonExpandableTd . attr ( 'aria-expanded' ) , undefined , 'no aria-expanded attribute' ) ;
159180 assert . strictEqual ( $nonExpandableTd . attr ( 'tabindex' ) , undefined , 'no tabindex attribute' ) ;
160181 } finally {
0 commit comments