@@ -85,7 +85,8 @@ describe('Rendering Tests', () => {
8585 imports : [
8686 NoopAnimationsModule ,
8787 IgxStepperSampleTestComponent ,
88- IgxStepperLinearComponent
88+ IgxStepperLinearComponent ,
89+ IgxStepperIndicatorNoShrinkComponent
8990 ]
9091 } ) . compileComponents ( ) ;
9192 } )
@@ -722,6 +723,23 @@ describe('Rendering Tests', () => {
722723 stepper . horizontalAnimationType = 'fade' ;
723724 testAnimationBehavior ( 'fade' , fix , false ) ;
724725 } ) ) ;
726+
727+ it ( 'should not shrink the step indicator in vertical orientation when titlePosition="end" and the title is very long' , fakeAsync ( ( ) => {
728+ const fixture = TestBed . createComponent ( IgxStepperIndicatorNoShrinkComponent ) ;
729+ fixture . detectChanges ( ) ;
730+ tick ( ) ;
731+
732+ const stepperInstance = fixture . componentInstance . stepper ;
733+ const indicator = stepperInstance . steps [ 0 ] . nativeElement . querySelector ( `.${ STEP_INDICATOR_CLASS } ` ) as HTMLElement ;
734+
735+ const { minWidth } = getComputedStyle ( indicator ) ;
736+ const { width, height } = indicator . getBoundingClientRect ( ) ;
737+
738+ expect ( minWidth ) . not . toBe ( '0px' ) ;
739+ expect ( minWidth ) . not . toBe ( 'auto' ) ;
740+ expect ( Math . abs ( width - height ) ) . toBeLessThan ( 1.5 ) ;
741+ expect ( Math . abs ( width - parseFloat ( minWidth ) ) ) . toBeLessThan ( 1.5 ) ;
742+ } ) ) ;
725743 } ) ;
726744
727745 describe ( 'Keyboard navigation' , ( ) => {
@@ -1378,3 +1396,34 @@ export class IgxStepperSampleTestComponent {
13781396export class IgxStepperLinearComponent {
13791397 @ViewChild ( IgxStepperComponent ) public stepper : IgxStepperComponent ;
13801398}
1399+
1400+ @Component ( {
1401+ template : `
1402+ <div>
1403+ <igx-stepper #stepper [orientation]="'vertical'" [titlePosition]="'end'">
1404+
1405+ <igx-step [active]="true">
1406+ <span igxStepTitle>{{ longTitle }}</span>
1407+ <div igxStepContent>Content</div>
1408+ </igx-step>
1409+
1410+ <igx-step>
1411+ <span igxStepTitle>Short</span>
1412+ <div igxStepContent>Content</div>
1413+ </igx-step>
1414+ </igx-stepper>
1415+ </div>
1416+ ` ,
1417+ imports : [
1418+ IgxStepperComponent ,
1419+ IgxStepComponent ,
1420+ IgxStepTitleDirective ,
1421+ IgxStepContentDirective
1422+ ]
1423+ } )
1424+ export class IgxStepperIndicatorNoShrinkComponent {
1425+ @ViewChild ( IgxStepperComponent ) public stepper : IgxStepperComponent ;
1426+
1427+ public longTitle =
1428+ 'This is a very very very very very very very very very very very very very very very very very very very very very long step title that should not shrink the indicator' ;
1429+ }
0 commit comments