@@ -4,11 +4,10 @@ import {
44} from '@angular/core/testing' ;
55import { Component } from '@angular/core' ;
66import { FormsModule } from '@angular/forms' ;
7- import { By } from '@angular/platform-browser' ;
87import { MdInputModule } from './index' ;
98import { ProjectionModule } from '../core/projection/projection' ;
109
11- fdescribe ( 'MdPlaceholder' , function ( ) {
10+ describe ( 'MdPlaceholder' , function ( ) {
1211 beforeEach ( async ( ( ) => {
1312 TestBed . configureTestingModule ( {
1413 imports : [ MdInputModule . forRoot ( ) , FormsModule , ProjectionModule . forRoot ( ) ] ,
@@ -29,11 +28,11 @@ fdescribe('MdPlaceholder', function () {
2928 let el : HTMLElement = fixture . nativeElement ;
3029 let labelEl : HTMLLabelElement = el . querySelector ( 'label' ) ;
3130 expect ( labelEl ) . not . toBeNull ( ) ;
32- expect ( labelEl . innerText ) . toEqual ( 'string placeholder' ) ;
31+ expect ( labelEl . textContent ) . toEqual ( 'string placeholder' ) ;
3332
3433 instance . required = true ;
3534 fixture . detectChanges ( ) ;
36- expect ( labelEl . innerText ) . toEqual ( 'string placeholder *' ) ;
35+ expect ( labelEl . textContent ) . toEqual ( 'string placeholder *' ) ;
3736 } ) ;
3837
3938 it ( 'works with template placeholder' , ( ) => {
@@ -44,11 +43,13 @@ fdescribe('MdPlaceholder', function () {
4443 let el : HTMLElement = fixture . nativeElement ;
4544 let labelEl : HTMLLabelElement = el . querySelector ( 'label' ) ;
4645 expect ( labelEl ) . not . toBeNull ( ) ;
47- expect ( labelEl . innerText ) . toEqual ( 'template placeholder' ) ;
46+ expect ( labelEl . textContent ) . toEqual ( 'template placeholder' ) ;
47+ expect ( labelEl . querySelector ( 'b' ) ) . not . toBeNull ( ) ;
48+ expect ( labelEl . querySelector ( 'b' ) . textContent ) . toEqual ( 'placeholder' ) ;
4849
4950 instance . required = true ;
5051 fixture . detectChanges ( ) ;
51- expect ( labelEl . innerText ) . toEqual ( 'template placeholder *' ) ;
52+ expect ( labelEl . textContent ) . toEqual ( 'template placeholder *' ) ;
5253 } ) ;
5354} ) ;
5455
@@ -59,7 +60,7 @@ class MdPlaceholderStringTestController {
5960
6061@Component ( { template : `
6162 <input md-input [required]="required" [placeholder]="p">
62- <template #p>template placeholder</template>
63+ <template #p>template <b> placeholder</b> </template>
6364` } )
6465class MdPlaceholderTemplateTestController {
6566 required : boolean = false ;
0 commit comments