@@ -22,7 +22,8 @@ describe('MatHorizontalStepper', () => {
2222 declarations : [
2323 SimpleMatHorizontalStepperApp ,
2424 SimplePreselectedMatHorizontalStepperApp ,
25- LinearMatHorizontalStepperApp
25+ LinearMatHorizontalStepperApp ,
26+ IconOverridesStepper ,
2627 ] ,
2728 providers : [
2829 { provide : Directionality , useFactory : ( ) => ( { value : dir } ) }
@@ -133,6 +134,41 @@ describe('MatHorizontalStepper', () => {
133134 } ) ;
134135 } ) ;
135136
137+ describe ( 'icon overrides' , ( ) => {
138+ let fixture : ComponentFixture < IconOverridesStepper > ;
139+
140+ beforeEach ( ( ) => {
141+ fixture = TestBed . createComponent ( IconOverridesStepper ) ;
142+ fixture . detectChanges ( ) ;
143+ } ) ;
144+
145+ it ( 'should allow for the `edit` icon to be overridden' , ( ) => {
146+ const stepperDebugElement = fixture . debugElement . query ( By . directive ( MatStepper ) ) ;
147+ const stepperComponent : MatStepper = stepperDebugElement . componentInstance ;
148+
149+ stepperComponent . _steps . toArray ( ) [ 0 ] . editable = true ;
150+ stepperComponent . next ( ) ;
151+ fixture . detectChanges ( ) ;
152+
153+ const header = stepperDebugElement . nativeElement . querySelector ( 'mat-step-header' ) ;
154+
155+ expect ( header . textContent ) . toContain ( 'Custom edit' ) ;
156+ } ) ;
157+
158+ it ( 'should allow for the `done` icon to be overridden' , ( ) => {
159+ const stepperDebugElement = fixture . debugElement . query ( By . directive ( MatStepper ) ) ;
160+ const stepperComponent : MatStepper = stepperDebugElement . componentInstance ;
161+
162+ stepperComponent . _steps . toArray ( ) [ 0 ] . editable = false ;
163+ stepperComponent . next ( ) ;
164+ fixture . detectChanges ( ) ;
165+
166+ const header = stepperDebugElement . nativeElement . querySelector ( 'mat-step-header' ) ;
167+
168+ expect ( header . textContent ) . toContain ( 'Custom done' ) ;
169+ } ) ;
170+ } ) ;
171+
136172 describe ( 'linear horizontal stepper' , ( ) => {
137173 let fixture : ComponentFixture < LinearMatHorizontalStepperApp > ;
138174 let testComponent : LinearMatHorizontalStepperApp ;
@@ -888,3 +924,18 @@ class LinearMatVerticalStepperApp {
888924class SimplePreselectedMatHorizontalStepperApp {
889925 index = 0 ;
890926}
927+
928+ @Component ( {
929+ template : `
930+ <mat-horizontal-stepper>
931+ <ng-template matStepperIcon="edit">Custom edit</ng-template>
932+ <ng-template matStepperIcon="done">Custom done</ng-template>
933+
934+ <mat-step>Content 1</mat-step>
935+ <mat-step>Content 2</mat-step>
936+ <mat-step>Content 3</mat-step>
937+ </mat-horizontal-stepper>
938+ `
939+ } )
940+ class IconOverridesStepper { }
941+
0 commit comments