@@ -295,6 +295,20 @@ describe('MdCheckbox', () => {
295
295
expect ( checkboxDebugElement . nativeElement . classList . contains ( 'custom-class' ) ) . toBe ( true ) ;
296
296
297
297
} ) ;
298
+
299
+ it ( 'should activate the ripple focused class when the input is focused' , ( ) => {
300
+ expect ( checkboxNativeElement . classList ) . not . toContain ( 'md-ripple-focused' ) ;
301
+
302
+ checkboxInstance . _onInputFocus ( ) ;
303
+ fixture . detectChanges ( ) ;
304
+
305
+ expect ( checkboxNativeElement . classList ) . toContain ( 'md-ripple-focused' ) ;
306
+
307
+ checkboxInstance . _onInputBlur ( ) ;
308
+ fixture . detectChanges ( ) ;
309
+
310
+ expect ( checkboxNativeElement . classList ) . not . toContain ( 'md-ripple-focused' ) ;
311
+ } ) ;
298
312
} ) ;
299
313
300
314
describe ( 'state transition css classes' , ( ) => {
@@ -555,13 +569,13 @@ describe('MdCheckbox', () => {
555
569
/** Simple component for testing a single checkbox. */
556
570
@Component ( {
557
571
template : `
558
- <div (click)="parentElementClicked = true" (keyup)="parentElementKeyedUp = true">
559
- <md-checkbox
572
+ <div (click)="parentElementClicked = true" (keyup)="parentElementKeyedUp = true">
573
+ <md-checkbox
560
574
id="simple-check"
561
575
[required]="isRequired"
562
576
[align]="alignment"
563
- [checked]="isChecked"
564
- [indeterminate]="isIndeterminate"
577
+ [checked]="isChecked"
578
+ [indeterminate]="isIndeterminate"
565
579
[disabled]="isDisabled"
566
580
[color]="checkboxColor"
567
581
(change)="changeCount = changeCount + 1"
@@ -612,9 +626,9 @@ class MultipleCheckboxes { }
612
626
/** Simple test component with tabIndex */
613
627
@Component ( {
614
628
template : `
615
- <md-checkbox
616
- [tabindex]="customTabIndex"
617
- [disabled]="isDisabled"
629
+ <md-checkbox
630
+ [tabindex]="customTabIndex"
631
+ [disabled]="isDisabled"
618
632
[disableRipple]="disableRipple">
619
633
</md-checkbox>` ,
620
634
} )
0 commit comments