Skip to content

Commit 83772bb

Browse files
committed
fixed group ripple disabled test
1 parent f82e27c commit 83772bb

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/lib/radio/radio.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ describe('MdRadio', () => {
232232
let rippleElement = radioNativeElements[0].querySelector('[md-ripple]');
233233
expect(rippleElement).toBeTruthy('Expected an enabled radio button to have a ripple');
234234

235-
radioInstances[0].disabled = true;
235+
testComponent.isFirstDisabled = true;
236236
fixture.detectChanges();
237237

238238
rippleElement = radioNativeElements[0].querySelector('[md-ripple]');
@@ -581,7 +581,8 @@ describe('MdRadio', () => {
581581
[labelPosition]="labelPos"
582582
[value]="groupValue"
583583
name="test-name">
584-
<md-radio-button value="fire" [disableRipple]="disableRipple">Charmander</md-radio-button>
584+
<md-radio-button value="fire" [disableRipple]="disableRipple"
585+
[disabled]="isFirstDisabled">Charmander</md-radio-button>
585586
<md-radio-button value="water" [disableRipple]="disableRipple">Squirtle</md-radio-button>
586587
<md-radio-button value="leaf" [disableRipple]="disableRipple">Bulbasaur</md-radio-button>
587588
</md-radio-group>
@@ -590,6 +591,7 @@ describe('MdRadio', () => {
590591
class RadiosInsideRadioGroup {
591592
labelPos: 'before' | 'after';
592593
isGroupDisabled: boolean = false;
594+
isFirstDisabled: boolean = false;
593595
groupValue: string = null;
594596
disableRipple: boolean = false;
595597
}

src/lib/radio/radio.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export class MdRadioGroup implements AfterContentInit, ControlValueAccessor {
140140
set labelPosition(v) {
141141
this._labelPosition = (v == 'before') ? 'before' : 'after';
142142
if (this._radios) {
143-
this._radios.forEach(radio => radio.groupValueChanged());
143+
this._radios.forEach(radio => radio._groupValueChanged());
144144
}
145145
}
146146

@@ -151,7 +151,7 @@ export class MdRadioGroup implements AfterContentInit, ControlValueAccessor {
151151
// The presence of *any* disabled value makes the component disabled, *except* for false.
152152
this._disabled = (value != null && value !== false) ? true : null;
153153
if (this._radios) {
154-
this._radios.forEach(radio => radio.groupValueChanged());
154+
this._radios.forEach(radio => radio._groupValueChanged());
155155
}
156156
}
157157

@@ -492,7 +492,7 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
492492
this._focusOriginMonitor.focusVia(this._inputElement.nativeElement, this._renderer, 'keyboard');
493493
}
494494

495-
groupValueChanged() {
495+
_groupValueChanged() {
496496
this._changeDetector.markForCheck();
497497
}
498498

0 commit comments

Comments
 (0)