@@ -8,7 +8,7 @@ import {MatCheckboxModule as MatMdcCheckboxModule} from '../index';
8
8
import { MatCheckboxHarness } from './checkbox-harness' ;
9
9
import { MatCheckboxHarness as MatMdcCheckboxHarness } from './mdc-checkbox-harness' ;
10
10
11
- let fixture : ComponentFixture < unknown > ;
11
+ let fixture : ComponentFixture < CheckboxHarnessTest > ;
12
12
let loader : HarnessLoader ;
13
13
let checkboxHarness : typeof MatCheckboxHarness ;
14
14
@@ -141,6 +141,7 @@ function runTests() {
141
141
} ) ;
142
142
143
143
it ( 'should toggle checkbox' , async ( ) => {
144
+ fixture . componentInstance . disabled = false ;
144
145
const checkboxes = await loader . getAllHarnesses ( checkboxHarness ) ;
145
146
await checkboxes [ 0 ] . toggle ( ) ;
146
147
await checkboxes [ 1 ] . toggle ( ) ;
@@ -149,6 +150,7 @@ function runTests() {
149
150
} ) ;
150
151
151
152
it ( 'should check checkbox' , async ( ) => {
153
+ fixture . componentInstance . disabled = false ;
152
154
const checkboxes = await loader . getAllHarnesses ( checkboxHarness ) ;
153
155
await checkboxes [ 0 ] . check ( ) ;
154
156
await checkboxes [ 1 ] . check ( ) ;
@@ -157,6 +159,7 @@ function runTests() {
157
159
} ) ;
158
160
159
161
it ( 'should uncheck checkbox' , async ( ) => {
162
+ fixture . componentInstance . disabled = false ;
160
163
const checkboxes = await loader . getAllHarnesses ( checkboxHarness ) ;
161
164
await checkboxes [ 0 ] . uncheck ( ) ;
162
165
await checkboxes [ 1 ] . uncheck ( ) ;
@@ -179,13 +182,14 @@ function getActiveElementTagName() {
179
182
aria-label="First checkbox">
180
183
First
181
184
</mat-checkbox>
182
- <mat-checkbox indeterminate="true" disabled="true " aria-labelledby="second-label">
185
+ <mat-checkbox indeterminate="true" [ disabled]="disabled " aria-labelledby="second-label">
183
186
Second
184
187
</mat-checkbox>
185
188
<span id="second-label">Second checkbox</span>
186
189
`
187
190
} )
188
191
class CheckboxHarnessTest {
189
192
ctrl = new FormControl ( true ) ;
193
+ disabled = true ;
190
194
}
191
195
0 commit comments