11import {
22 it ,
33 beforeEach ,
4+ beforeEachProviders ,
45 inject ,
56 async ,
67 fakeAsync ,
78 flushMicrotasks ,
89 tick
910} 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' ;
1118import { TestComponentBuilder , ComponentFixture } from '@angular/compiler/testing' ;
1219import { Component , DebugElement } from '@angular/core' ;
1320import { By } from '@angular/platform-browser' ;
@@ -22,6 +29,11 @@ describe('MdCheckbox', () => {
2229 let builder : TestComponentBuilder ;
2330 let fixture : ComponentFixture < any > ;
2431
32+ beforeEachProviders ( ( ) => [
33+ disableDeprecatedForms ( ) ,
34+ provideForms ( ) ,
35+ ] ) ;
36+
2537 beforeEach ( inject ( [ TestComponentBuilder ] , ( tcb : TestComponentBuilder ) => {
2638 builder = tcb ;
2739 } ) ) ;
@@ -432,7 +444,7 @@ describe('MdCheckbox', () => {
432444 } ) ;
433445 } ) ;
434446
435- describe ( 'with ngModel and ngControl ' , ( ) => {
447+ describe ( 'with ngModel' , ( ) => {
436448 beforeEach ( async ( ( ) => {
437449 builder . createAsync ( CheckboxWithFormDirectives ) . then ( f => {
438450 f . detectChanges ( ) ;
@@ -501,12 +513,12 @@ class SingleCheckbox {
501513 onCheckboxClick ( event : Event ) { }
502514}
503515
504- /** Simple component for testing an MdCheckbox with ngModel and ngControl . */
516+ /** Simple component for testing an MdCheckbox with ngModel. */
505517@Component ( {
506518 directives : [ MdCheckbox , FORM_DIRECTIVES , NgModel ] ,
507519 template : `
508520 <form>
509- <md-checkbox ngControl ="cb" [(ngModel)]="isGood">Be good</md-checkbox>
521+ <md-checkbox name ="cb" [(ngModel)]="isGood">Be good</md-checkbox>
510522 </form>
511523 ` ,
512524} )
0 commit comments