11import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
2- import { ReactiveFormsModule , FormControl , FormsModule } from '@angular/forms' ;
2+ import { FormControl , FormsModule , ReactiveFormsModule } from '@angular/forms' ;
33import { Component , DebugElement } from '@angular/core' ;
44import { By , HAMMER_GESTURE_CONFIG } from '@angular/platform-browser' ;
55import { MdSlider , MdSliderModule } from './index' ;
66import { TestGestureConfig } from './test-gesture-config' ;
77import { RtlModule } from '../core/rtl/dir' ;
88import {
9- UP_ARROW ,
10- RIGHT_ARROW ,
119 DOWN_ARROW ,
12- PAGE_DOWN ,
13- PAGE_UP ,
1410 END ,
1511 HOME ,
16- LEFT_ARROW
12+ LEFT_ARROW ,
13+ PAGE_DOWN ,
14+ PAGE_UP ,
15+ RIGHT_ARROW ,
16+ UP_ARROW
1717} from '../core/keyboard/keycodes' ;
1818import { dispatchKeyboardEvent , dispatchMouseEvent } from '../core/testing/dispatch-events' ;
1919
@@ -23,7 +23,7 @@ describe('MdSlider', () => {
2323
2424 beforeEach ( async ( ( ) => {
2525 TestBed . configureTestingModule ( {
26- imports : [ MdSliderModule . forRoot ( ) , RtlModule . forRoot ( ) , ReactiveFormsModule , FormsModule ] ,
26+ imports : [ MdSliderModule , ReactiveFormsModule , FormsModule , RtlModule ] ,
2727 declarations : [
2828 StandardSlider ,
2929 DisabledSlider ,
@@ -129,28 +129,6 @@ describe('MdSlider', () => {
129129 expect ( trackFillElement . style . transform ) . toContain ( 'scaleX(0.86)' ) ;
130130 } ) ;
131131
132- it ( 'should add the mat-slider-active class on click' , ( ) => {
133- expect ( sliderNativeElement . classList ) . not . toContain ( 'mat-slider-active' ) ;
134-
135- dispatchClickEventSequence ( sliderNativeElement , 0.23 ) ;
136- fixture . detectChanges ( ) ;
137-
138- expect ( sliderNativeElement . classList ) . toContain ( 'mat-slider-active' ) ;
139- } ) ;
140-
141- it ( 'should remove the mat-slider-active class on blur' , ( ) => {
142- dispatchClickEventSequence ( sliderNativeElement , 0.95 ) ;
143- fixture . detectChanges ( ) ;
144-
145- expect ( sliderNativeElement . classList ) . toContain ( 'mat-slider-active' ) ;
146-
147- // Call the `onBlur` handler directly because we cannot simulate a focus event in unit tests.
148- sliderInstance . _onBlur ( ) ;
149- fixture . detectChanges ( ) ;
150-
151- expect ( sliderNativeElement . classList ) . not . toContain ( 'mat-slider-active' ) ;
152- } ) ;
153-
154132 it ( 'should add and remove the mat-slider-sliding class when sliding' , ( ) => {
155133 expect ( sliderNativeElement . classList ) . not . toContain ( 'mat-slider-sliding' ) ;
156134
@@ -167,11 +145,6 @@ describe('MdSlider', () => {
167145
168146 it ( 'should have thumb gap when at min value' , ( ) => {
169147 expect ( trackFillElement . style . transform ) . toContain ( 'translateX(-7px)' ) ;
170-
171- dispatchClickEventSequence ( sliderNativeElement , 0 ) ;
172- fixture . detectChanges ( ) ;
173-
174- expect ( trackFillElement . style . transform ) . toContain ( 'translateX(-10px)' ) ;
175148 } ) ;
176149
177150 it ( 'should not have thumb gap when not at min value' , ( ) => {
@@ -561,29 +534,6 @@ describe('MdSlider', () => {
561534 // The thumb label text is set to the slider's value. These should always be the same.
562535 expect ( thumbLabelTextElement . textContent ) . toBe ( `${ sliderInstance . value } ` ) ;
563536 } ) ;
564-
565- it ( 'should show the thumb label on click' , ( ) => {
566- expect ( sliderNativeElement . classList ) . not . toContain ( 'mat-slider-active' ) ;
567- expect ( sliderNativeElement . classList ) . toContain ( 'mat-slider-thumb-label-showing' ) ;
568-
569- dispatchClickEventSequence ( sliderNativeElement , 0.49 ) ;
570- fixture . detectChanges ( ) ;
571-
572- // The thumb label appears when the slider is active and the 'mat-slider-thumb-label-showing'
573- // class is applied.
574- expect ( sliderNativeElement . classList ) . toContain ( 'mat-slider-thumb-label-showing' ) ;
575- expect ( sliderNativeElement . classList ) . toContain ( 'mat-slider-active' ) ;
576- } ) ;
577-
578- it ( 'should show the thumb label on slide' , ( ) => {
579- expect ( sliderNativeElement . classList ) . not . toContain ( 'mat-slider-active' ) ;
580-
581- dispatchSlideEventSequence ( sliderNativeElement , 0 , 0.91 , gestureConfig ) ;
582- fixture . detectChanges ( ) ;
583-
584- expect ( sliderNativeElement . classList ) . toContain ( 'mat-slider-thumb-label-showing' ) ;
585- expect ( sliderNativeElement . classList ) . toContain ( 'mat-slider-active' ) ;
586- } ) ;
587537 } ) ;
588538
589539 describe ( 'slider as a custom form control' , ( ) => {
0 commit comments