@@ -261,12 +261,13 @@ describe('MdInput', function () {
261
261
. then ( fixture => {
262
262
fixture . detectChanges ( ) ;
263
263
264
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
264
265
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
265
266
266
267
expect ( el ) . not . toBeNull ( ) ;
267
268
expect ( el . getAttribute ( 'autocomplete' ) ) . toBeNull ( ) ;
268
269
269
- fixture . componentInstance . autoComplete = 'on' ;
270
+ input . autoComplete = 'on' ;
270
271
fixture . detectChanges ( ) ;
271
272
expect ( el . getAttribute ( 'autocomplete' ) ) . toEqual ( 'on' ) ;
272
273
} ) ;
@@ -310,12 +311,13 @@ describe('MdInput', function () {
310
311
. then ( fixture => {
311
312
fixture . detectChanges ( ) ;
312
313
314
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
313
315
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
314
316
315
317
expect ( el ) . not . toBeNull ( ) ;
316
318
expect ( el . getAttribute ( 'autofocus' ) ) . toBeNull ( ) ;
317
319
318
- fixture . componentInstance . autoFocus = true ;
320
+ input . autoFocus = true ;
319
321
fixture . detectChanges ( ) ;
320
322
expect ( el . getAttribute ( 'autofocus' ) ) . toEqual ( '' ) ;
321
323
} ) ;
@@ -342,12 +344,14 @@ describe('MdInput', function () {
342
344
builder . overrideTemplate ( MdInputOptionalAttributeController , template )
343
345
. createAsync ( MdInputOptionalAttributeController )
344
346
. then ( fixture => {
345
- fixture . componentInstance . disabled = false ;
347
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
348
+ input . disabled = false ;
346
349
fixture . detectChanges ( ) ;
347
350
348
351
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
349
-
350
352
expect ( el ) . not . toBeNull ( ) ;
353
+
354
+ fixture . detectChanges ( ) ;
351
355
expect ( el . getAttribute ( 'disabled' ) ) . toEqual ( null ) ;
352
356
353
357
fixture . componentInstance . disabled = true ;
@@ -377,15 +381,15 @@ describe('MdInput', function () {
377
381
builder . overrideTemplate ( MdInputOptionalAttributeController , template )
378
382
. createAsync ( MdInputOptionalAttributeController )
379
383
. then ( fixture => {
380
- fixture . componentInstance . disabled = false ;
384
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
385
+ input . disabled = false ;
381
386
fixture . detectChanges ( ) ;
382
387
383
388
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
384
-
385
- expect ( el ) . not . toBeNull ( ) ;
389
+ fixture . detectChanges ( ) ;
386
390
expect ( el . getAttribute ( 'list' ) ) . toEqual ( null ) ;
387
391
388
- fixture . componentInstance . list = 'datalist-id' ;
392
+ input . list = 'datalist-id' ;
389
393
fixture . detectChanges ( ) ;
390
394
expect ( el . getAttribute ( 'list' ) ) . toEqual ( 'datalist-id' ) ;
391
395
} ) ;
@@ -397,19 +401,21 @@ describe('MdInput', function () {
397
401
builder . overrideTemplate ( MdInputOptionalAttributeController , template )
398
402
. createAsync ( MdInputOptionalAttributeController )
399
403
. then ( fixture => {
400
- fixture . componentInstance . disabled = false ;
404
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
405
+ input . disabled = false ;
401
406
fixture . detectChanges ( ) ;
402
407
403
408
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
404
-
405
409
expect ( el ) . not . toBeNull ( ) ;
410
+
411
+ fixture . detectChanges ( ) ;
406
412
expect ( el . getAttribute ( 'max' ) ) . toEqual ( null ) ;
407
413
408
- fixture . componentInstance . max = 10 ;
414
+ input . max = 10 ;
409
415
fixture . detectChanges ( ) ;
410
416
expect ( el . getAttribute ( 'max' ) ) . toEqual ( '10' ) ;
411
417
412
- fixture . componentInstance . max = '2000-01-02' ;
418
+ input . max = '2000-01-02' ;
413
419
fixture . detectChanges ( ) ;
414
420
expect ( el . getAttribute ( 'max' ) ) . toEqual ( '2000-01-02' ) ;
415
421
} ) ;
@@ -421,19 +427,20 @@ describe('MdInput', function () {
421
427
builder . overrideTemplate ( MdInputOptionalAttributeController , template )
422
428
. createAsync ( MdInputOptionalAttributeController )
423
429
. then ( fixture => {
424
- fixture . componentInstance . disabled = false ;
430
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
431
+ input . disabled = false ;
425
432
fixture . detectChanges ( ) ;
426
433
427
434
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
428
-
429
435
expect ( el ) . not . toBeNull ( ) ;
436
+ fixture . detectChanges ( ) ;
430
437
expect ( el . getAttribute ( 'min' ) ) . toEqual ( null ) ;
431
438
432
- fixture . componentInstance . min = 10 ;
439
+ input . min = 10 ;
433
440
fixture . detectChanges ( ) ;
434
441
expect ( el . getAttribute ( 'min' ) ) . toEqual ( '10' ) ;
435
442
436
- fixture . componentInstance . min = '2000-01-02' ;
443
+ input . min = '2000-01-02' ;
437
444
fixture . detectChanges ( ) ;
438
445
expect ( el . getAttribute ( 'min' ) ) . toEqual ( '2000-01-02' ) ;
439
446
} ) ;
@@ -448,11 +455,12 @@ describe('MdInput', function () {
448
455
fixture . detectChanges ( ) ;
449
456
450
457
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
458
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
451
459
452
460
expect ( el ) . not . toBeNull ( ) ;
453
461
expect ( el . getAttribute ( 'readonly' ) ) . toBeNull ( ) ;
454
462
455
- fixture . componentInstance . readOnly = true ;
463
+ input . readOnly = true ;
456
464
fixture . detectChanges ( ) ;
457
465
expect ( el . getAttribute ( 'readonly' ) ) . toEqual ( '' ) ;
458
466
} ) ;
@@ -481,12 +489,13 @@ describe('MdInput', function () {
481
489
. then ( fixture => {
482
490
fixture . detectChanges ( ) ;
483
491
492
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
484
493
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
485
494
486
495
expect ( el ) . not . toBeNull ( ) ;
487
496
expect ( el . getAttribute ( 'required' ) ) . toBeNull ( ) ;
488
497
489
- fixture . componentInstance . required = true ;
498
+ input . required = true ;
490
499
fixture . detectChanges ( ) ;
491
500
expect ( el . getAttribute ( 'required' ) ) . toEqual ( '' ) ;
492
501
} ) ;
@@ -515,12 +524,13 @@ describe('MdInput', function () {
515
524
. then ( fixture => {
516
525
fixture . detectChanges ( ) ;
517
526
527
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
518
528
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
519
529
520
530
expect ( el ) . not . toBeNull ( ) ;
521
531
expect ( el . getAttribute ( 'spellcheck' ) ) . toEqual ( 'false' ) ;
522
532
523
- fixture . componentInstance . spellCheck = true ;
533
+ input . spellCheck = true ;
524
534
fixture . detectChanges ( ) ;
525
535
expect ( el . getAttribute ( 'spellcheck' ) ) . toEqual ( 'true' ) ;
526
536
} ) ;
@@ -549,12 +559,13 @@ describe('MdInput', function () {
549
559
. then ( fixture => {
550
560
fixture . detectChanges ( ) ;
551
561
562
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
552
563
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
553
564
554
565
expect ( el ) . not . toBeNull ( ) ;
555
566
expect ( el . getAttribute ( 'step' ) ) . toEqual ( null ) ;
556
567
557
- fixture . componentInstance . step = 0.5 ;
568
+ input . step = 0.5 ;
558
569
fixture . detectChanges ( ) ;
559
570
expect ( el . getAttribute ( 'step' ) ) . toEqual ( '0.5' ) ;
560
571
} ) ;
@@ -568,12 +579,13 @@ describe('MdInput', function () {
568
579
. then ( fixture => {
569
580
fixture . detectChanges ( ) ;
570
581
582
+ let input : MdInput = fixture . debugElement . query ( By . directive ( MdInput ) ) . componentInstance ;
571
583
let el : HTMLInputElement = fixture . debugElement . query ( By . css ( 'input' ) ) . nativeElement ;
572
584
573
585
expect ( el ) . not . toBeNull ( ) ;
574
586
expect ( el . getAttribute ( 'tabindex' ) ) . toEqual ( null ) ;
575
587
576
- fixture . componentInstance . tabIndex = 1 ;
588
+ input . tabIndex = 1 ;
577
589
fixture . detectChanges ( ) ;
578
590
expect ( el . getAttribute ( 'tabindex' ) ) . toEqual ( '1' ) ;
579
591
} ) ;
0 commit comments