1
1
import {
2
2
it ,
3
3
beforeEach ,
4
+ beforeEachProviders ,
4
5
inject ,
5
6
async ,
6
7
fakeAsync ,
7
8
flushMicrotasks ,
8
9
tick
9
10
} from '@angular/core/testing' ;
10
- import { FORM_DIRECTIVES , NgModel , NgControl } from '@angular/common' ;
11
+ import {
12
+ FORM_DIRECTIVES ,
13
+ NgModel ,
14
+ NgControl ,
15
+ disableDeprecatedForms ,
16
+ provideForms
17
+ } from '@angular/forms' ;
11
18
import { TestComponentBuilder , ComponentFixture } from '@angular/compiler/testing' ;
12
19
import { Component , DebugElement } from '@angular/core' ;
13
20
import { By } from '@angular/platform-browser' ;
@@ -22,6 +29,11 @@ describe('MdCheckbox', () => {
22
29
let builder : TestComponentBuilder ;
23
30
let fixture : ComponentFixture < any > ;
24
31
32
+ beforeEachProviders ( ( ) => [
33
+ disableDeprecatedForms ( ) ,
34
+ provideForms ( ) ,
35
+ ] ) ;
36
+
25
37
beforeEach ( inject ( [ TestComponentBuilder ] , ( tcb : TestComponentBuilder ) => {
26
38
builder = tcb ;
27
39
} ) ) ;
@@ -432,7 +444,7 @@ describe('MdCheckbox', () => {
432
444
} ) ;
433
445
} ) ;
434
446
435
- describe ( 'with ngModel and ngControl ' , ( ) => {
447
+ describe ( 'with ngModel' , ( ) => {
436
448
beforeEach ( async ( ( ) => {
437
449
builder . createAsync ( CheckboxWithFormDirectives ) . then ( f => {
438
450
f . detectChanges ( ) ;
@@ -501,12 +513,12 @@ class SingleCheckbox {
501
513
onCheckboxClick ( event : Event ) { }
502
514
}
503
515
504
- /** Simple component for testing an MdCheckbox with ngModel and ngControl . */
516
+ /** Simple component for testing an MdCheckbox with ngModel. */
505
517
@Component ( {
506
518
directives : [ MdCheckbox , FORM_DIRECTIVES , NgModel ] ,
507
519
template : `
508
520
<form>
509
- <md-checkbox ngControl ="cb" [(ngModel)]="isGood">Be good</md-checkbox>
521
+ <md-checkbox name ="cb" [(ngModel)]="isGood">Be good</md-checkbox>
510
522
</form>
511
523
` ,
512
524
} )
0 commit comments