@@ -299,12 +299,13 @@ describe('MdInput', function () {
299
299
fakeAsync ( ( ) => {
300
300
fixture . detectChanges ( ) ;
301
301
302
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
302
303
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
303
304
304
305
expect ( el ) . not . toBeNull ( ) ;
305
306
expect ( el . getAttribute ( 'autocomplete' ) ) . toBeNull ( ) ;
306
307
307
- fixture . componentInstance . autoComplete = 'on' ;
308
+ input . autoComplete = 'on' ;
308
309
fixture . detectChanges ( ) ;
309
310
expect ( el . getAttribute ( 'autocomplete' ) ) . toEqual ( 'on' ) ;
310
311
} ) ( ) ;
@@ -354,12 +355,13 @@ describe('MdInput', function () {
354
355
fakeAsync ( ( ) => {
355
356
fixture . detectChanges ( ) ;
356
357
358
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
357
359
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
358
360
359
361
expect ( el ) . not . toBeNull ( ) ;
360
362
expect ( el . getAttribute ( 'autofocus' ) ) . toBeNull ( ) ;
361
363
362
- fixture . componentInstance . autoFocus = true ;
364
+ input . autoFocus = true ;
363
365
fixture . detectChanges ( ) ;
364
366
expect ( el . getAttribute ( 'autofocus' ) ) . toEqual ( '' ) ;
365
367
} ) ( ) ;
@@ -390,15 +392,15 @@ describe('MdInput', function () {
390
392
. createAsync ( MdInputOptionalAttributeController )
391
393
. then ( fixture => {
392
394
fakeAsync ( ( ) => {
393
- fixture . componentInstance . disabled = false ;
394
- fixture . detectChanges ( ) ;
395
-
395
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
396
396
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
397
-
398
397
expect ( el ) . not . toBeNull ( ) ;
398
+
399
+ input . disabled = false ;
400
+ fixture . detectChanges ( ) ;
399
401
expect ( el . getAttribute ( 'disabled' ) ) . toEqual ( null ) ;
400
402
401
- fixture . componentInstance . disabled = true ;
403
+ input . disabled = true ;
402
404
fixture . detectChanges ( ) ;
403
405
expect ( el . getAttribute ( 'disabled' ) ) . toEqual ( '' ) ;
404
406
} ) ( ) ;
@@ -429,15 +431,15 @@ describe('MdInput', function () {
429
431
. createAsync ( MdInputOptionalAttributeController )
430
432
. then ( fixture => {
431
433
fakeAsync ( ( ) => {
432
- fixture . componentInstance . disabled = false ;
433
- fixture . detectChanges ( ) ;
434
-
434
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
435
435
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
436
-
437
436
expect ( el ) . not . toBeNull ( ) ;
437
+
438
+ input . disabled = false ;
439
+ fixture . detectChanges ( ) ;
438
440
expect ( el . getAttribute ( 'list' ) ) . toEqual ( null ) ;
439
441
440
- fixture . componentInstance . list = 'datalist-id' ;
442
+ input . list = 'datalist-id' ;
441
443
fixture . detectChanges ( ) ;
442
444
expect ( el . getAttribute ( 'list' ) ) . toEqual ( 'datalist-id' ) ;
443
445
} ) ( ) ;
@@ -451,19 +453,19 @@ describe('MdInput', function () {
451
453
. createAsync ( MdInputOptionalAttributeController )
452
454
. then ( fixture => {
453
455
fakeAsync ( ( ) => {
454
- fixture . componentInstance . disabled = false ;
455
- fixture . detectChanges ( ) ;
456
-
456
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
457
457
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
458
-
459
458
expect ( el ) . not . toBeNull ( ) ;
459
+
460
+ input . disabled = false ;
461
+ fixture . detectChanges ( ) ;
460
462
expect ( el . getAttribute ( 'max' ) ) . toEqual ( null ) ;
461
463
462
- fixture . componentInstance . max = 10 ;
464
+ input . max = 10 ;
463
465
fixture . detectChanges ( ) ;
464
466
expect ( el . getAttribute ( 'max' ) ) . toEqual ( '10' ) ;
465
467
466
- fixture . componentInstance . max = '2000-01-02' ;
468
+ input . max = '2000-01-02' ;
467
469
fixture . detectChanges ( ) ;
468
470
expect ( el . getAttribute ( 'max' ) ) . toEqual ( '2000-01-02' ) ;
469
471
} ) ( ) ;
@@ -477,19 +479,19 @@ describe('MdInput', function () {
477
479
. createAsync ( MdInputOptionalAttributeController )
478
480
. then ( fixture => {
479
481
fakeAsync ( ( ) => {
480
- fixture . componentInstance . disabled = false ;
481
- fixture . detectChanges ( ) ;
482
-
482
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
483
483
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
484
-
485
484
expect ( el ) . not . toBeNull ( ) ;
485
+
486
+ input . disabled = false ;
487
+ fixture . detectChanges ( ) ;
486
488
expect ( el . getAttribute ( 'min' ) ) . toEqual ( null ) ;
487
489
488
- fixture . componentInstance . min = 10 ;
490
+ input . min = 10 ;
489
491
fixture . detectChanges ( ) ;
490
492
expect ( el . getAttribute ( 'min' ) ) . toEqual ( '10' ) ;
491
493
492
- fixture . componentInstance . min = '2000-01-02' ;
494
+ input . min = '2000-01-02' ;
493
495
fixture . detectChanges ( ) ;
494
496
expect ( el . getAttribute ( 'min' ) ) . toEqual ( '2000-01-02' ) ;
495
497
} ) ( ) ;
@@ -505,12 +507,13 @@ describe('MdInput', function () {
505
507
fakeAsync ( ( ) => {
506
508
fixture . detectChanges ( ) ;
507
509
510
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
508
511
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
509
512
510
513
expect ( el ) . not . toBeNull ( ) ;
511
514
expect ( el . getAttribute ( 'readonly' ) ) . toBeNull ( ) ;
512
515
513
- fixture . componentInstance . readOnly = true ;
516
+ input . readOnly = true ;
514
517
fixture . detectChanges ( ) ;
515
518
expect ( el . getAttribute ( 'readonly' ) ) . toEqual ( '' ) ;
516
519
} ) ( ) ;
@@ -543,12 +546,13 @@ describe('MdInput', function () {
543
546
fakeAsync ( ( ) => {
544
547
fixture . detectChanges ( ) ;
545
548
549
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
546
550
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
547
551
548
552
expect ( el ) . not . toBeNull ( ) ;
549
553
expect ( el . getAttribute ( 'required' ) ) . toBeNull ( ) ;
550
554
551
- fixture . componentInstance . required = true ;
555
+ input . required = true ;
552
556
fixture . detectChanges ( ) ;
553
557
expect ( el . getAttribute ( 'required' ) ) . toEqual ( '' ) ;
554
558
} ) ( ) ;
@@ -581,12 +585,13 @@ describe('MdInput', function () {
581
585
fakeAsync ( ( ) => {
582
586
fixture . detectChanges ( ) ;
583
587
588
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
584
589
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
585
590
586
591
expect ( el ) . not . toBeNull ( ) ;
587
592
expect ( el . getAttribute ( 'spellcheck' ) ) . toEqual ( 'false' ) ;
588
593
589
- fixture . componentInstance . spellCheck = true ;
594
+ input . spellCheck = true ;
590
595
fixture . detectChanges ( ) ;
591
596
expect ( el . getAttribute ( 'spellcheck' ) ) . toEqual ( 'true' ) ;
592
597
} ) ( ) ;
@@ -619,12 +624,13 @@ describe('MdInput', function () {
619
624
fakeAsync ( ( ) => {
620
625
fixture . detectChanges ( ) ;
621
626
627
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
622
628
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
623
629
624
630
expect ( el ) . not . toBeNull ( ) ;
625
631
expect ( el . getAttribute ( 'step' ) ) . toEqual ( null ) ;
626
632
627
- fixture . componentInstance . step = 0.5 ;
633
+ input . step = 0.5 ;
628
634
fixture . detectChanges ( ) ;
629
635
expect ( el . getAttribute ( 'step' ) ) . toEqual ( '0.5' ) ;
630
636
} ) ( ) ;
@@ -640,12 +646,13 @@ describe('MdInput', function () {
640
646
fakeAsync ( ( ) => {
641
647
fixture . detectChanges ( ) ;
642
648
649
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
643
650
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
644
651
645
652
expect ( el ) . not . toBeNull ( ) ;
646
653
expect ( el . getAttribute ( 'tabindex' ) ) . toEqual ( null ) ;
647
654
648
- fixture . componentInstance . tabIndex = 1 ;
655
+ input . tabIndex = 1 ;
649
656
fixture . detectChanges ( ) ;
650
657
expect ( el . getAttribute ( 'tabindex' ) ) . toEqual ( '1' ) ;
651
658
} ) ( ) ;
0 commit comments