@@ -115,19 +115,19 @@ describe('MatStepper', () => {
115115 } ) ;
116116
117117 it ( 'should display the correct label' , ( ) => {
118- let selectedLabel = fixture . nativeElement . querySelector ( '[aria-selected="true "]' ) ;
118+ let selectedLabel = fixture . nativeElement . querySelector ( '[aria-current="step "]' ) ;
119119 expect ( selectedLabel . textContent ) . toMatch ( 'Step 1' ) ;
120120
121121 fixture . componentInstance . stepper . selectedIndex = 2 ;
122122 fixture . detectChanges ( ) ;
123123
124- selectedLabel = fixture . nativeElement . querySelector ( '[aria-selected="true "]' ) ;
124+ selectedLabel = fixture . nativeElement . querySelector ( '[aria-current="step "]' ) ;
125125 expect ( selectedLabel . textContent ) . toMatch ( 'Step 3' ) ;
126126
127127 fixture . componentInstance . inputLabel . set ( 'New Label' ) ;
128128 fixture . detectChanges ( ) ;
129129
130- selectedLabel = fixture . nativeElement . querySelector ( '[aria-selected="true "]' ) ;
130+ selectedLabel = fixture . nativeElement . querySelector ( '[aria-current="step "]' ) ;
131131 expect ( selectedLabel . textContent ) . toMatch ( 'New Label' ) ;
132132 } ) ;
133133
@@ -337,15 +337,6 @@ describe('MatStepper', () => {
337337 animationDoneSubscription . unsubscribe ( ) ;
338338 } ) ;
339339
340- it ( 'should set the correct aria-posinset and aria-setsize' , ( ) => {
341- const headers = Array . from < HTMLElement > (
342- fixture . nativeElement . querySelectorAll ( '[role="tab"]' ) ,
343- ) ;
344-
345- expect ( headers . map ( header => header . getAttribute ( 'aria-posinset' ) ) ) . toEqual ( [ '1' , '2' , '3' ] ) ;
346- expect ( headers . every ( header => header . getAttribute ( 'aria-setsize' ) === '3' ) ) . toBe ( true ) ;
347- } ) ;
348-
349340 it ( 'should adjust the index when removing a step before the current one' , ( ) => {
350341 const stepper = fixture . componentInstance . stepper ;
351342
@@ -932,14 +923,6 @@ describe('MatStepper', () => {
932923 } ) ;
933924
934925 describe ( 'vertical stepper' , ( ) => {
935- it ( 'should set the aria-orientation to "vertical"' , ( ) => {
936- const fixture = createComponent ( SimpleMatVerticalStepperApp ) ;
937- fixture . detectChanges ( ) ;
938-
939- const stepperEl = fixture . debugElement . query ( By . css ( '[role="tablist"]' ) ) ! . nativeElement ;
940- expect ( stepperEl . getAttribute ( 'aria-orientation' ) ) . toBe ( 'vertical' ) ;
941- } ) ;
942-
943926 it ( 'should support using the left/right arrows to move focus' , ( ) => {
944927 const fixture = createComponent ( SimpleMatVerticalStepperApp ) ;
945928 fixture . detectChanges ( ) ;
@@ -1061,6 +1044,18 @@ describe('MatStepper', () => {
10611044 assertArrowKeyInteractionInRtl ( fixture , stepHeaders ) ;
10621045 } ) ;
10631046
1047+ it ( 'should set the correct aria-posinset and aria-setsize' , ( ) => {
1048+ const fixture = createComponent ( SimpleMatHorizontalStepperApp ) ;
1049+ fixture . detectChanges ( ) ;
1050+
1051+ const headers = Array . from < HTMLElement > (
1052+ fixture . nativeElement . querySelectorAll ( '.mat-step-header' ) ,
1053+ ) ;
1054+
1055+ expect ( headers . map ( header => header . getAttribute ( 'aria-posinset' ) ) ) . toEqual ( [ '1' , '2' , '3' ] ) ;
1056+ expect ( headers . every ( header => header . getAttribute ( 'aria-setsize' ) === '3' ) ) . toBe ( true ) ;
1057+ } ) ;
1058+
10641059 it ( 'should maintain the correct navigation order when a step is added later on' , ( ) => {
10651060 const fixture = createComponent ( HorizontalStepperWithDelayedStep ) ;
10661061 fixture . detectChanges ( ) ;
0 commit comments