@@ -261,12 +261,13 @@ describe('MdInput', function () {
261261 . then ( fixture => {
262262 fixture . detectChanges ( ) ;
263263
264+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
264265 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
265266
266267 expect ( el ) . not . toBeNull ( ) ;
267268 expect ( el . getAttribute ( 'autocomplete' ) ) . toBeNull ( ) ;
268269
269- fixture . componentInstance . autoComplete = 'on' ;
270+ input . autoComplete = 'on' ;
270271 fixture . detectChanges ( ) ;
271272 expect ( el . getAttribute ( 'autocomplete' ) ) . toEqual ( 'on' ) ;
272273 } ) ;
@@ -310,12 +311,13 @@ describe('MdInput', function () {
310311 . then ( fixture => {
311312 fixture . detectChanges ( ) ;
312313
314+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
313315 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
314316
315317 expect ( el ) . not . toBeNull ( ) ;
316318 expect ( el . getAttribute ( 'autofocus' ) ) . toBeNull ( ) ;
317319
318- fixture . componentInstance . autoFocus = true ;
320+ input . autoFocus = true ;
319321 fixture . detectChanges ( ) ;
320322 expect ( el . getAttribute ( 'autofocus' ) ) . toEqual ( '' ) ;
321323 } ) ;
@@ -342,12 +344,14 @@ describe('MdInput', function () {
342344 builder . overrideTemplate ( MdInputOptionalAttributeController , template )
343345 . createAsync ( MdInputOptionalAttributeController )
344346 . then ( fixture => {
345- fixture . componentInstance . disabled = false ;
347+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
348+ input . disabled = false ;
346349 fixture . detectChanges ( ) ;
347350
348351 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
349-
350352 expect ( el ) . not . toBeNull ( ) ;
353+
354+ fixture . detectChanges ( ) ;
351355 expect ( el . getAttribute ( 'disabled' ) ) . toEqual ( null ) ;
352356
353357 fixture . componentInstance . disabled = true ;
@@ -377,15 +381,15 @@ describe('MdInput', function () {
377381 builder . overrideTemplate ( MdInputOptionalAttributeController , template )
378382 . createAsync ( MdInputOptionalAttributeController )
379383 . then ( fixture => {
380- fixture . componentInstance . disabled = false ;
384+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
385+ input . disabled = false ;
381386 fixture . detectChanges ( ) ;
382387
383388 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
384-
385- expect ( el ) . not . toBeNull ( ) ;
389+ fixture . detectChanges ( ) ;
386390 expect ( el . getAttribute ( 'list' ) ) . toEqual ( null ) ;
387391
388- fixture . componentInstance . list = 'datalist-id' ;
392+ input . list = 'datalist-id' ;
389393 fixture . detectChanges ( ) ;
390394 expect ( el . getAttribute ( 'list' ) ) . toEqual ( 'datalist-id' ) ;
391395 } ) ;
@@ -397,19 +401,21 @@ describe('MdInput', function () {
397401 builder . overrideTemplate ( MdInputOptionalAttributeController , template )
398402 . createAsync ( MdInputOptionalAttributeController )
399403 . then ( fixture => {
400- fixture . componentInstance . disabled = false ;
404+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
405+ input . disabled = false ;
401406 fixture . detectChanges ( ) ;
402407
403408 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
404-
405409 expect ( el ) . not . toBeNull ( ) ;
410+
411+ fixture . detectChanges ( ) ;
406412 expect ( el . getAttribute ( 'max' ) ) . toEqual ( null ) ;
407413
408- fixture . componentInstance . max = 10 ;
414+ input . max = 10 ;
409415 fixture . detectChanges ( ) ;
410416 expect ( el . getAttribute ( 'max' ) ) . toEqual ( '10' ) ;
411417
412- fixture . componentInstance . max = '2000-01-02' ;
418+ input . max = '2000-01-02' ;
413419 fixture . detectChanges ( ) ;
414420 expect ( el . getAttribute ( 'max' ) ) . toEqual ( '2000-01-02' ) ;
415421 } ) ;
@@ -421,19 +427,20 @@ describe('MdInput', function () {
421427 builder . overrideTemplate ( MdInputOptionalAttributeController , template )
422428 . createAsync ( MdInputOptionalAttributeController )
423429 . then ( fixture => {
424- fixture . componentInstance . disabled = false ;
430+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
431+ input . disabled = false ;
425432 fixture . detectChanges ( ) ;
426433
427434 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
428-
429435 expect ( el ) . not . toBeNull ( ) ;
436+ fixture . detectChanges ( ) ;
430437 expect ( el . getAttribute ( 'min' ) ) . toEqual ( null ) ;
431438
432- fixture . componentInstance . min = 10 ;
439+ input . min = 10 ;
433440 fixture . detectChanges ( ) ;
434441 expect ( el . getAttribute ( 'min' ) ) . toEqual ( '10' ) ;
435442
436- fixture . componentInstance . min = '2000-01-02' ;
443+ input . min = '2000-01-02' ;
437444 fixture . detectChanges ( ) ;
438445 expect ( el . getAttribute ( 'min' ) ) . toEqual ( '2000-01-02' ) ;
439446 } ) ;
@@ -448,11 +455,12 @@ describe('MdInput', function () {
448455 fixture . detectChanges ( ) ;
449456
450457 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
458+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
451459
452460 expect ( el ) . not . toBeNull ( ) ;
453461 expect ( el . getAttribute ( 'readonly' ) ) . toBeNull ( ) ;
454462
455- fixture . componentInstance . readOnly = true ;
463+ input . readOnly = true ;
456464 fixture . detectChanges ( ) ;
457465 expect ( el . getAttribute ( 'readonly' ) ) . toEqual ( '' ) ;
458466 } ) ;
@@ -481,12 +489,13 @@ describe('MdInput', function () {
481489 . then ( fixture => {
482490 fixture . detectChanges ( ) ;
483491
492+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
484493 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
485494
486495 expect ( el ) . not . toBeNull ( ) ;
487496 expect ( el . getAttribute ( 'required' ) ) . toBeNull ( ) ;
488497
489- fixture . componentInstance . required = true ;
498+ input . required = true ;
490499 fixture . detectChanges ( ) ;
491500 expect ( el . getAttribute ( 'required' ) ) . toEqual ( '' ) ;
492501 } ) ;
@@ -515,12 +524,13 @@ describe('MdInput', function () {
515524 . then ( fixture => {
516525 fixture . detectChanges ( ) ;
517526
527+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
518528 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
519529
520530 expect ( el ) . not . toBeNull ( ) ;
521531 expect ( el . getAttribute ( 'spellcheck' ) ) . toEqual ( 'false' ) ;
522532
523- fixture . componentInstance . spellCheck = true ;
533+ input . spellCheck = true ;
524534 fixture . detectChanges ( ) ;
525535 expect ( el . getAttribute ( 'spellcheck' ) ) . toEqual ( 'true' ) ;
526536 } ) ;
@@ -549,12 +559,13 @@ describe('MdInput', function () {
549559 . then ( fixture => {
550560 fixture . detectChanges ( ) ;
551561
562+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
552563 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
553564
554565 expect ( el ) . not . toBeNull ( ) ;
555566 expect ( el . getAttribute ( 'step' ) ) . toEqual ( null ) ;
556567
557- fixture . componentInstance . step = 0.5 ;
568+ input . step = 0.5 ;
558569 fixture . detectChanges ( ) ;
559570 expect ( el . getAttribute ( 'step' ) ) . toEqual ( '0.5' ) ;
560571 } ) ;
@@ -568,12 +579,13 @@ describe('MdInput', function () {
568579 . then ( fixture => {
569580 fixture . detectChanges ( ) ;
570581
582+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
571583 let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
572584
573585 expect ( el ) . not . toBeNull ( ) ;
574586 expect ( el . getAttribute ( 'tabindex' ) ) . toEqual ( null ) ;
575587
576- fixture . componentInstance . tabIndex = 1 ;
588+ input . tabIndex = 1 ;
577589 fixture . detectChanges ( ) ;
578590 expect ( el . getAttribute ( 'tabindex' ) ) . toEqual ( '1' ) ;
579591 } ) ;
0 commit comments