@@ -152,7 +152,7 @@ describe('MdRadio', () => {
152
152
expect ( spies [ 1 ] ) . toHaveBeenCalledTimes ( 1 ) ;
153
153
} ) ;
154
154
155
- it ( `should not emit a change event from the radio group when change group value
155
+ it ( `should not emit a change event from the radio group when change group value
156
156
programmatically` , ( ) => {
157
157
expect ( groupInstance . value ) . toBeFalsy ( ) ;
158
158
@@ -235,7 +235,7 @@ describe('MdRadio', () => {
235
235
}
236
236
} ) ) ;
237
237
238
- it ( `should update the group's selected radio to null when unchecking that radio
238
+ it ( `should update the group's selected radio to null when unchecking that radio
239
239
programmatically` , ( ) => {
240
240
let changeSpy = jasmine . createSpy ( 'radio-group change listener' ) ;
241
241
groupInstance . change . subscribe ( changeSpy ) ;
@@ -485,6 +485,24 @@ describe('MdRadio', () => {
485
485
486
486
expect ( fruitRadioNativeInputs [ 0 ] . getAttribute ( 'aria-labelledby' ) ) . toBe ( 'uvw' ) ;
487
487
} ) ;
488
+
489
+ it ( 'should add a ripple when the native input element is focused' , ( ) => {
490
+ let hostElement = seasonRadioInstances [ 0 ] . getHostElement ( ) as HTMLElement ;
491
+ let input = hostElement . querySelector ( 'input' ) as HTMLInputElement ;
492
+ let label = hostElement . querySelector ( 'label' ) as HTMLLabelElement ;
493
+
494
+ expect ( label . classList ) . not . toContain ( 'md-ripple-focused' ) ;
495
+
496
+ dispatchEvent ( 'focus' , input ) ;
497
+ fixture . detectChanges ( ) ;
498
+
499
+ expect ( label . classList ) . toContain ( 'md-ripple-focused' ) ;
500
+
501
+ dispatchEvent ( 'blur' , input ) ;
502
+ fixture . detectChanges ( ) ;
503
+
504
+ expect ( label . classList ) . not . toContain ( 'md-ripple-focused' ) ;
505
+ } ) ;
488
506
} ) ;
489
507
} ) ;
490
508
@@ -514,11 +532,11 @@ class RadiosInsideRadioGroup {
514
532
<md-radio-button name="season" value="spring">Spring</md-radio-button>
515
533
<md-radio-button name="season" value="summer">Summer</md-radio-button>
516
534
<md-radio-button name="season" value="autum">Autumn</md-radio-button>
517
-
535
+
518
536
<md-radio-button name="weather" value="warm">Spring</md-radio-button>
519
537
<md-radio-button name="weather" value="hot">Summer</md-radio-button>
520
538
<md-radio-button name="weather" value="cool">Autumn</md-radio-button>
521
-
539
+
522
540
<span id="xyz">Baby Banana</span>
523
541
<md-radio-button name="fruit" value="banana" aria-label="Banana" aria-labelledby="xyz">
524
542
</md-radio-button>
0 commit comments