@@ -440,11 +440,19 @@ describe('Rendering Tests', () => {
440
440
it ( 'should place the title in the step element according to the specified titlePosition when stepType is set to "full"' , ( ) => {
441
441
stepper . orientation = IgxStepperOrientation . Horizontal ;
442
442
stepper . stepType = IgxStepType . Full ;
443
+ stepper . titlePosition = null ;
443
444
fix . detectChanges ( ) ;
444
445
446
+ //test default title positions
447
+ for ( const step of stepper . steps ) {
448
+ expect ( step . titlePosition ) . toBe ( stepper . _defaultTitlePosition ) ;
449
+ expect ( step . titlePosition ) . toBe ( IgxStepperTitlePosition . Bottom ) ;
450
+ expect ( step . nativeElement ) . toHaveClass ( `igx-stepper__step--${ stepper . _defaultTitlePosition } ` ) ;
451
+ }
452
+
445
453
let positions = getStepperPositions ( ) ;
446
454
positions . forEach ( ( pos : IgxStepperTitlePosition ) => {
447
- stepper . horizontalTitlePosition = pos ;
455
+ stepper . titlePosition = pos ;
448
456
fix . detectChanges ( ) ;
449
457
450
458
for ( const step of stepper . steps ) {
@@ -453,11 +461,19 @@ describe('Rendering Tests', () => {
453
461
} ) ;
454
462
455
463
stepper . orientation = IgxStepperOrientation . Vertical ;
464
+ stepper . titlePosition = null ;
456
465
fix . detectChanges ( ) ;
457
466
467
+ //test default title positions
468
+ for ( const step of stepper . steps ) {
469
+ expect ( step . titlePosition ) . toBe ( stepper . _defaultTitlePosition ) ;
470
+ expect ( step . titlePosition ) . toBe ( IgxStepperTitlePosition . End ) ;
471
+ expect ( step . nativeElement ) . toHaveClass ( `igx-stepper__step--${ stepper . _defaultTitlePosition } ` ) ;
472
+ }
473
+
458
474
positions = getStepperPositions ( ) ;
459
475
positions . forEach ( ( pos : IgxStepperTitlePosition ) => {
460
- stepper . verticalTitlePosition = pos ;
476
+ stepper . titlePosition = pos ;
461
477
fix . detectChanges ( ) ;
462
478
463
479
for ( const step of stepper . steps ) {
@@ -544,20 +560,11 @@ describe('Rendering Tests', () => {
544
560
testAnimationBehvior ( val , fix , false ) ;
545
561
}
546
562
547
- const dummyTestValues = [ - 1 , 'sampleString' , [ ] , { } ] ;
548
-
549
- for ( const val of dummyTestValues ) {
550
- expect ( ( ) => {
551
- fix . componentInstance . animationDuration = val as any ;
552
- testAnimationBehvior ( val , fix , false ) ;
553
- } ) . toThrow ( ) ;
554
- }
555
-
556
- const fallbackToDefaultValues = [ 0 , null ] ;
563
+ const fallbackToDefaultValues = [ - 1 , 0 , null , undefined , 'sampleString' , [ ] , { } ] ;
557
564
for ( const val of fallbackToDefaultValues ) {
558
565
fix . componentInstance . animationDuration = val as any ;
559
566
fix . detectChanges ( ) ;
560
- expect ( stepper . animationDuration ) . withContext ( 'Set 0/null animation duration and verify default value' )
567
+ expect ( stepper . animationDuration )
561
568
. toBe ( ( stepper as any ) . _defaultAnimationDuration ) ;
562
569
testAnimationBehvior ( val , fix , false ) ;
563
570
}
@@ -989,13 +996,6 @@ describe('Stepper service unit tests', () => {
989
996
}
990
997
} ) ;
991
998
992
- it ( 'should properly register the specified stepper' , ( ) => {
993
- stepperService = new IgxStepperService ( ) ;
994
- expect ( ( stepperService as any ) . stepper ) . toBeFalsy ( ) ;
995
- stepperService . register ( stepper ) ;
996
- expect ( ( stepperService as any ) . stepper ) . toEqual ( stepper ) ;
997
- } ) ;
998
-
999
999
it ( 'should expand a step by activating it and firing the step\'s activeChange event' , ( ) => {
1000
1000
spyOnProperty ( stepper , 'orientation' , 'get' ) . and . returnValue ( IgxStepperOrientation . Horizontal ) ;
1001
1001
expect ( stepper . orientation ) . toBe ( IgxStepperOrientation . Horizontal ) ;
0 commit comments