@@ -15,8 +15,8 @@ const THUMB_TO_CLASS = '.igx-slider__thumb-to';
1515const THUMB_FROM_CLASS = '.igx-slider__thumb-from' ;
1616const SLIDER_TICKS_ELEMENT = '.igx-slider__ticks' ;
1717const SLIDER_TICKS_TOP_ELEMENT = '.igx-slider__ticks--top' ;
18- const SLIDER_PRIMARY_GROUP_TICKS_CLASS = '.igx-slider__ticks-group--tall' ;
1918const SLIDER_PRIMARY_GROUP_TICKS_CLASS_NAME = 'igx-slider__ticks-group--tall' ;
19+ const SLIDER_PRIMARY_GROUP_TICKS_CLASS = `.${ SLIDER_PRIMARY_GROUP_TICKS_CLASS_NAME } ` ;
2020const SLIDER_GROUP_TICKS_CLASS = '.igx-slider__ticks-group' ;
2121const SLIDER_TICK_LABELS_CLASS = '.igx-slider__ticks-label' ;
2222const SLIDER_TICK_LABELS_HIDDEN_CLASS = 'igx-slider__tick-label--hidden' ;
@@ -1427,6 +1427,24 @@ describe('IgxSlider', () => {
14271427 expect ( secondaryTicks . length ) . toEqual ( ( expectedPrimary - 1 ) * expectedSecondary ) ;
14281428 } ) ;
14291429
1430+ it ( 'check primary ticks length (16px)' , ( ) => {
1431+ const ticks = fixture . debugElement . query ( By . css ( SLIDER_TICKS_ELEMENT ) ) ;
1432+ fixture . componentInstance . primaryTicks = 5 ;
1433+ fixture . detectChanges ( ) ;
1434+
1435+ const primaryTick = ticks . nativeElement . querySelectorAll ( SLIDER_PRIMARY_GROUP_TICKS_CLASS ) [ 0 ] ;
1436+ expect ( primaryTick . firstElementChild . getBoundingClientRect ( ) . height ) . toEqual ( 16 ) ;
1437+ } ) ;
1438+
1439+ it ( 'check secondary ticks length (8px)' , ( ) => {
1440+ const ticks = fixture . debugElement . query ( By . css ( SLIDER_TICKS_ELEMENT ) ) ;
1441+ fixture . componentInstance . secondaryTicks = 5 ;
1442+ fixture . detectChanges ( ) ;
1443+
1444+ const primaryTick = ticks . nativeElement . querySelectorAll ( SLIDER_GROUP_TICKS_CLASS ) [ 0 ] ;
1445+ expect ( primaryTick . firstElementChild . getBoundingClientRect ( ) . height ) . toEqual ( 8 ) ;
1446+ } ) ;
1447+
14301448 it ( 'hide/show top and bottom ticks' , ( ) => {
14311449 let ticks = fixture . debugElement . nativeElement . querySelector ( SLIDER_TICKS_ELEMENT ) ;
14321450 let ticksTop = fixture . debugElement . nativeElement . querySelector ( SLIDER_TICKS_TOP_ELEMENT ) ;
@@ -1485,6 +1503,7 @@ describe('IgxSlider', () => {
14851503 verifySecondaryTicsLabelsAreHidden ( ticks , false ) ;
14861504 } ) ;
14871505
1506+
14881507 it ( 'show/hide secondary tick labels' , ( ) => {
14891508 const ticks = fixture . debugElement . query ( By . css ( SLIDER_TICKS_ELEMENT ) ) ;
14901509 const primaryTicks = 5 ;
@@ -1559,6 +1578,25 @@ describe('IgxSlider', () => {
15591578 expect ( labelsTopBottom ) . not . toBeNull ( ) ;
15601579 expect ( labelsBottomTop ) . toBeNull ( ) ;
15611580 } ) ;
1581+
1582+ it ( 'ticks change should reflect dynamically when slider labels are changed' , ( ) => {
1583+ const ticks = fixture . debugElement . query ( By . css ( SLIDER_TICKS_ELEMENT ) ) ;
1584+ let labels = [ 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' , 'Saturday' , 'Sunday' ] ;
1585+ slider . labels = labels ;
1586+ fixture . detectChanges ( ) ;
1587+
1588+ let primaryTicks = ticks . nativeElement . querySelectorAll ( SLIDER_PRIMARY_GROUP_TICKS_CLASS ) ;
1589+ expect ( primaryTicks . length ) . toEqual ( labels . length ) ;
1590+
1591+ labels = labels . splice ( 0 , labels . length - 2 ) ;
1592+ slider . labels = labels ;
1593+ fixture . detectChanges ( ) ;
1594+
1595+ primaryTicks = ticks . nativeElement . querySelectorAll ( SLIDER_PRIMARY_GROUP_TICKS_CLASS ) ;
1596+
1597+ expect ( primaryTicks . length ) . toEqual ( labels . length ) ;
1598+
1599+ } ) ;
15621600 } ) ;
15631601
15641602 describe ( 'EditorProvider' , ( ) => {
@@ -1677,7 +1715,8 @@ export class SliderRtlComponent {
16771715 `
16781716} )
16791717export class SliderTicksComponent {
1680- @ViewChild ( IgxSliderComponent )
1718+
1719+ @ViewChild ( IgxSliderComponent , { static : true } )
16811720 public slider : IgxSliderComponent ;
16821721
16831722 public primaryTicks = 0 ;
0 commit comments