Skip to content

Commit fbcf612

Browse files
committed
fixed group ripple disabled test
1 parent a4b8880 commit fbcf612

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
@@ -243,7 +243,7 @@ describe('MdRadio', () => {
243243
let rippleElement = radioNativeElements[0].querySelector('[md-ripple]');
244244
expect(rippleElement).toBeTruthy('Expected an enabled radio button to have a ripple');
245245

246-
radioInstances[0].disabled = true;
246+
testComponent.isFirstDisabled = true;
247247
fixture.detectChanges();
248248

249249
rippleElement = radioNativeElements[0].querySelector('[md-ripple]');
@@ -592,7 +592,8 @@ describe('MdRadio', () => {
592592
[labelPosition]="labelPos"
593593
[value]="groupValue"
594594
name="test-name">
595-
<md-radio-button value="fire" [disableRipple]="disableRipple">Charmander</md-radio-button>
595+
<md-radio-button value="fire" [disableRipple]="disableRipple"
596+
[disabled]="isFirstDisabled">Charmander</md-radio-button>
596597
<md-radio-button value="water" [disableRipple]="disableRipple">Squirtle</md-radio-button>
597598
<md-radio-button value="leaf" [disableRipple]="disableRipple">Bulbasaur</md-radio-button>
598599
</md-radio-group>
@@ -601,6 +602,7 @@ describe('MdRadio', () => {
601602
class RadiosInsideRadioGroup {
602603
labelPos: 'before' | 'after';
603604
isGroupDisabled: boolean = false;
605+
isFirstDisabled: boolean = false;
604606
groupValue: string = null;
605607
disableRipple: boolean = false;
606608
}

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

@@ -450,7 +450,7 @@ export class MdRadioButton implements OnInit {
450450
this._disabled = (value != null && value !== false) ? true : null;
451451
}
452452

453-
groupValueChanged() {
453+
_groupValueChanged() {
454454
this._changeDetector.markForCheck();
455455
}
456456

0 commit comments

Comments
 (0)