@@ -45,21 +45,17 @@ describe('radio harness', () => {
4545 expect ( await groups [ 0 ] . getId ( ) ) . toBe ( 'my-group-1' ) ;
4646 } ) ;
4747
48- it (
49- 'should throw when finding radio-group with specific name that has mismatched ' +
50- 'radio-button names' ,
51- async ( ) => {
52- fixture . componentInstance . thirdGroupButtonName = 'other-name' ;
53- fixture . changeDetectorRef . markForCheck ( ) ;
54- fixture . detectChanges ( ) ;
55-
56- await expectAsync (
57- loader . getAllHarnesses ( MatRadioGroupHarness . with ( { name : 'third-group-name' } ) ) ,
58- ) . toBeRejectedWithError (
59- / l o c a t o r f o u n d a r a d i o - g r o u p w i t h n a m e " t h i r d - g r o u p - n a m e " .* h a v e m i s m a t c h i n g n a m e s / ,
60- ) ;
61- } ,
62- ) ;
48+ it ( 'should throw when finding radio-group with specific name that has mismatched radio-button names' , async ( ) => {
49+ fixture . componentInstance . thirdGroupButtonName = 'other-name' ;
50+ fixture . changeDetectorRef . markForCheck ( ) ;
51+ fixture . detectChanges ( ) ;
52+
53+ await expectAsync (
54+ loader . getAllHarnesses ( MatRadioGroupHarness . with ( { name : 'third-group-name' } ) ) ,
55+ ) . toBeRejectedWithError (
56+ / l o c a t o r f o u n d a r a d i o - g r o u p w i t h n a m e " t h i r d - g r o u p - n a m e " .* h a v e m i s m a t c h i n g n a m e s / ,
57+ ) ;
58+ } ) ;
6359
6460 it ( 'should get name of radio-group' , async ( ) => {
6561 const groups = await loader . getAllHarnesses ( MatRadioGroupHarness ) ;
@@ -214,6 +210,20 @@ describe('radio harness', () => {
214210 expect ( await firstRadio . isDisabled ( ) ) . toBe ( true ) ;
215211 } ) ;
216212
213+ it ( 'should get the disabled state with disabledInteractive is enabled' , async ( ) => {
214+ fixture . componentInstance . disabledInteractive = true ;
215+ fixture . changeDetectorRef . markForCheck ( ) ;
216+
217+ const [ firstRadio ] = await loader . getAllHarnesses ( MatRadioButtonHarness ) ;
218+ expect ( await firstRadio . isDisabled ( ) ) . toBe ( false ) ;
219+
220+ fixture . componentInstance . disableAll = true ;
221+ fixture . changeDetectorRef . markForCheck ( ) ;
222+ fixture . detectChanges ( ) ;
223+
224+ expect ( await firstRadio . isDisabled ( ) ) . toBe ( true ) ;
225+ } ) ;
226+
217227 it ( 'should focus radio-button' , async ( ) => {
218228 const radioButton = await loader . getHarness ( MatRadioButtonHarness . with ( { selector : '#opt2' } ) ) ;
219229 expect ( await radioButton . isFocused ( ) ) . toBe ( false ) ;
@@ -272,6 +282,7 @@ describe('radio harness', () => {
272282 <mat-radio-button
273283 [name]="value === 'opt3' ? 'group2' : 'group1'"
274284 [disabled]="disableAll"
285+ [disabledInteractive]="disabledInteractive"
275286 [checked]="value === 'opt2'"
276287 [id]="value"
277288 [required]="value === 'opt2'"
@@ -307,6 +318,7 @@ describe('radio harness', () => {
307318class MultipleRadioButtonsHarnessTest {
308319 values = [ 'opt1' , 'opt2' , 'opt3' ] ;
309320 disableAll = false ;
321+ disabledInteractive = false ;
310322 secondGroupId = 'my-group-2' ;
311323 thirdGroupName : string = 'third-group-name' ;
312324 thirdGroupButtonName : string | undefined = undefined ;
0 commit comments