@@ -83,7 +83,8 @@ describe('Rendering Tests', () => {
8383 imports : [
8484 NoopAnimationsModule ,
8585 IgxStepperSampleTestComponent ,
86- IgxStepperLinearComponent
86+ IgxStepperLinearComponent ,
87+ IgxStepperIndicatorNoShrinkComponent
8788 ]
8889 } ) . compileComponents ( ) ;
8990 } )
@@ -720,6 +721,23 @@ describe('Rendering Tests', () => {
720721 stepper . horizontalAnimationType = 'fade' ;
721722 testAnimationBehavior ( 'fade' , fix , false ) ;
722723 } ) ) ;
724+
725+ it ( 'should not shrink the step indicator in vertical orientation when titlePosition="end" and the title is very long' , fakeAsync ( ( ) => {
726+ const fixture = TestBed . createComponent ( IgxStepperIndicatorNoShrinkComponent ) ;
727+ fixture . detectChanges ( ) ;
728+ tick ( ) ;
729+
730+ const stepperInstance = fixture . componentInstance . stepper ;
731+ const indicator = stepperInstance . steps [ 0 ] . nativeElement . querySelector ( `.${ STEP_INDICATOR_CLASS } ` ) as HTMLElement ;
732+
733+ const { minWidth } = getComputedStyle ( indicator ) ;
734+ const { width, height } = indicator . getBoundingClientRect ( ) ;
735+
736+ expect ( minWidth ) . not . toBe ( '0px' ) ;
737+ expect ( minWidth ) . not . toBe ( 'auto' ) ;
738+ expect ( Math . abs ( width - height ) ) . toBeLessThan ( 1.5 ) ;
739+ expect ( Math . abs ( width - parseFloat ( minWidth ) ) ) . toBeLessThan ( 1.5 ) ;
740+ } ) ) ;
723741 } ) ;
724742
725743 describe ( 'Keyboard navigation' , ( ) => {
@@ -1358,3 +1376,32 @@ export class IgxStepperSampleTestComponent {
13581376export class IgxStepperLinearComponent {
13591377 @ViewChild ( IgxStepperComponent ) public stepper : IgxStepperComponent ;
13601378}
1379+
1380+ @Component ( {
1381+ template : `
1382+ <div>
1383+ <igx-stepper #stepper [orientation]="'vertical'" [titlePosition]="'end'">
1384+ <igx-step [active]="true">
1385+ <span igxStepTitle>{{ longTitle }}</span>
1386+ <div igxStepContent>Content</div>
1387+ </igx-step>
1388+ <igx-step>
1389+ <span igxStepTitle>Short</span>
1390+ <div igxStepContent>Content</div>
1391+ </igx-step>
1392+ </igx-stepper>
1393+ </div>
1394+ ` ,
1395+ imports : [
1396+ IgxStepperComponent ,
1397+ IgxStepComponent ,
1398+ IgxStepTitleDirective ,
1399+ IgxStepContentDirective
1400+ ]
1401+ } )
1402+ export class IgxStepperIndicatorNoShrinkComponent {
1403+ @ViewChild ( IgxStepperComponent ) public stepper : IgxStepperComponent ;
1404+
1405+ public longTitle =
1406+ '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' ;
1407+ }
0 commit comments