Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/lib/stepper/stepper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ describe('MatHorizontalStepper', () => {
expect(stepperEl.getAttribute('role')).toBe('tablist');
});

it('should set the proper "aria-orientation"', () => {
let stepperEl = fixture.debugElement.query(By.css('mat-horizontal-stepper')).nativeElement;
expect(stepperEl.getAttribute('aria-orientation')).toBe('horizontal');
});

it('should set aria-expanded of content correctly', () => {
let stepContents = fixture.debugElement.queryAll(By.css(`.mat-horizontal-stepper-content`));
assertCorrectAriaExpandedAttribute(fixture, stepContents);
Expand Down Expand Up @@ -227,6 +232,11 @@ describe('MatVerticalStepper', () => {
expect(stepperEl.getAttribute('role')).toBe('tablist');
});

it('should set the proper "aria-orientation"', () => {
let stepperEl = fixture.debugElement.query(By.css('mat-vertical-stepper')).nativeElement;
expect(stepperEl.getAttribute('aria-orientation')).toBe('vertical');
});

it('should set aria-expanded of content correctly', () => {
let stepContents = fixture.debugElement.queryAll(By.css(`.mat-vertical-stepper-content`));
assertCorrectAriaExpandedAttribute(fixture, stepContents);
Expand Down
2 changes: 2 additions & 0 deletions src/lib/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export class MatStepper extends _MatStepper implements AfterContentInit {
inputs: ['selectedIndex'],
host: {
'class': 'mat-stepper-horizontal',
'aria-orientation': 'horizontal',
'role': 'tablist',
},
animations: [
Expand All @@ -116,6 +117,7 @@ export class MatHorizontalStepper extends MatStepper { }
inputs: ['selectedIndex'],
host: {
'class': 'mat-stepper-vertical',
'aria-orientation': 'vertical',
'role': 'tablist',
},
animations: [
Expand Down