@@ -13,6 +13,7 @@ describe('MdInput', function () {
1313 TestBed . configureTestingModule ( {
1414 imports : [ MdInputModule . forRoot ( ) , FormsModule , ProjectionModule . forRoot ( ) ] ,
1515 declarations : [
16+ MdInputStyleClassTransferedTestComponent ,
1617 MdInputNumberTypeConservedTestComponent ,
1718 MdInputInvalidTypeTestController ,
1819 MdInputBaseTestController ,
@@ -49,6 +50,15 @@ describe('MdInput', function () {
4950 } ) ;
5051 } ) ) ;
5152
53+ it ( 'moves the class and style to the outer container' , async ( ( ) => {
54+ let fixture = TestBed . createComponent ( MdInputStyleClassTransferedTestComponent ) ;
55+ fixture . detectChanges ( ) ;
56+
57+ let el = fixture . debugElement . query ( By . directive ( MdInput ) ) . nativeElement ;
58+ expect ( el . getAttribute ( 'class' ) ) . toBeNull ( ) ;
59+ expect ( el . getAttribute ( 'style' ) ) . toBeNull ( ) ;
60+ } ) ) ;
61+
5262 it ( 'counts characters' , async ( ( ) => {
5363 let fixture = TestBed . createComponent ( MdInputBaseTestController ) ;
5464 let instance = fixture . componentInstance ;
@@ -88,6 +98,10 @@ describe('MdInput', function () {
8898
8999} ) ;
90100
101+ @Component ( { template : `<input md-input type="number" class="test-class" style="color: 123456">` } )
102+ class MdInputStyleClassTransferedTestComponent {
103+ }
104+
91105@Component ( { template : `<input md-input type="number" [(ngModel)]="value">` } )
92106class MdInputNumberTypeConservedTestComponent {
93107 value : number = 0 ;
@@ -103,7 +117,7 @@ class MdInputBaseTestController {
103117
104118@Component ( {
105119 template : `
106- <textarea md-input [rows]="rows" [cols]="cols" [wrap]="wrap" placeholder="Snacks">
120+ <textarea md-textarea [rows]="rows" [cols]="cols" [wrap]="wrap" placeholder="Snacks">
107121 </textarea>
108122 ` } )
109123class MdTextareaWithBindings {
0 commit comments