@@ -45,21 +45,17 @@ describe('radio harness', () => {
45
45
expect(await groups[0].getId()).toBe('my-group-1');
46
46
});
47
47
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
- /locator found a radio-group with name "third-group-name".*have mismatching names/,
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
+ /locator found a radio-group with name "third-group-name".*have mismatching names/,
57
+ );
58
+ });
63
59
64
60
it('should get name of radio-group', async () => {
65
61
const groups = await loader.getAllHarnesses(MatRadioGroupHarness);
@@ -214,6 +210,20 @@ describe('radio harness', () => {
214
210
expect(await firstRadio.isDisabled()).toBe(true);
215
211
});
216
212
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
+
217
227
it('should focus radio-button', async () => {
218
228
const radioButton = await loader.getHarness(MatRadioButtonHarness.with({selector: '#opt2'}));
219
229
expect(await radioButton.isFocused()).toBe(false);
@@ -272,6 +282,7 @@ describe('radio harness', () => {
272
282
<mat-radio-button
273
283
[name]="value === 'opt3' ? 'group2' : 'group1'"
274
284
[disabled]="disableAll"
285
+ [disabledInteractive]="disabledInteractive"
275
286
[checked]="value === 'opt2'"
276
287
[id]="value"
277
288
[required]="value === 'opt2'"
@@ -307,6 +318,7 @@ describe('radio harness', () => {
307
318
class MultipleRadioButtonsHarnessTest {
308
319
values = ['opt1', 'opt2', 'opt3'];
309
320
disableAll = false;
321
+ disabledInteractive = false;
310
322
secondGroupId = 'my-group-2';
311
323
thirdGroupName: string = 'third-group-name';
312
324
thirdGroupButtonName: string | undefined = undefined;
0 commit comments