Skip to content

Commit 8d4e68e

Browse files
committed
test(material/stepper): updates role value for stepper.spec.ts
Updates stepper.spec.ts to check for region role for the vertical stepper based on the new role updates.
1 parent eabd3dd commit 8d4e68e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/material/stepper/stepper.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,28 +132,28 @@ describe('MatStepper', () => {
132132
expect(stepperComponent.selected instanceof MatStep).toBe(true);
133133
});
134134

135-
it('should set the "tablist" role on stepper', () => {
135+
it('should set the "region" role on the vertical stepper', () => {
136136
const stepperEl = fixture.debugElement.query(By.css('mat-stepper'))!.nativeElement;
137-
expect(stepperEl.getAttribute('role')).toBe('tablist');
137+
expect(stepperEl.getAttribute('role')).toBe('region');
138138
});
139139

140140
it('should display the correct label', () => {
141141
const stepperComponent = fixture.debugElement.query(
142142
By.directive(MatStepper),
143143
)!.componentInstance;
144-
let selectedLabel = fixture.nativeElement.querySelector('[aria-selected="true"]');
144+
let selectedLabel = fixture.nativeElement.querySelector('[aria-expanded="true"]');
145145
expect(selectedLabel.textContent).toMatch('Step 1');
146146

147147
stepperComponent.selectedIndex = 2;
148148
fixture.detectChanges();
149149

150-
selectedLabel = fixture.nativeElement.querySelector('[aria-selected="true"]');
150+
selectedLabel = fixture.nativeElement.querySelector('[aria-expanded="true"]');
151151
expect(selectedLabel.textContent).toMatch('Step 3');
152152

153153
fixture.componentInstance.inputLabel.set('New Label');
154154
fixture.detectChanges();
155155

156-
selectedLabel = fixture.nativeElement.querySelector('[aria-selected="true"]');
156+
selectedLabel = fixture.nativeElement.querySelector('[aria-expanded="true"]');
157157
expect(selectedLabel.textContent).toMatch('New Label');
158158
});
159159

0 commit comments

Comments
 (0)