@@ -2,6 +2,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
22import { ValidationMessageComponent } from './validation-message.component' ;
33import { ValidationError } from '../validation-error' ;
44import { Component , ViewChild } from '@angular/core' ;
5+ import { ControlContainer } from '@angular/forms' ;
56
67describe ( 'ValidationMessageComponent' , ( ) => {
78 describe ( 'canHandle' , ( ) => {
@@ -15,8 +16,9 @@ describe('ValidationMessageComponent', () => {
1516 required : true
1617 }
1718 } ;
18- component = new ValidationMessageComponent ( undefined ) ;
19- error = ValidationError . fromFirstError ( control ) ;
19+
20+ component = new ValidationMessageComponent ( < any > undefined ) ;
21+ error = < ValidationError > ValidationError . fromFirstError ( control ) ;
2022 } ) ;
2123
2224 it ( `returns true when the error key and component key are equal (without for)` , ( ) => {
@@ -67,7 +69,7 @@ describe('ValidationMessageComponent', () => {
6769 } ) ;
6870
6971 it ( `are displayed by the show function` , ( ) => {
70- const error = ValidationError . fromFirstError ( TestHostComponent . getFormControl ( ) ) ;
72+ const error = < ValidationError > ValidationError . fromFirstError ( TestHostComponent . getFormControl ( ) ) ;
7173
7274 validationMessageComponent . show ( error ) ;
7375
@@ -79,7 +81,7 @@ describe('ValidationMessageComponent', () => {
7981 } ) ;
8082
8183 it ( `are hidden by the reset function` , ( ) => {
82- const error = ValidationError . fromFirstError ( TestHostComponent . getFormControl ( ) ) ;
84+ const error = < ValidationError > ValidationError . fromFirstError ( TestHostComponent . getFormControl ( ) ) ;
8385
8486 validationMessageComponent . show ( error ) ;
8587 fixture . detectChanges ( ) ;
@@ -89,7 +91,7 @@ describe('ValidationMessageComponent', () => {
8991 } ) ;
9092
9193 it ( `and their context is set by the show function` , ( ) => {
92- const error = ValidationError . fromFirstError ( TestHostComponent . getFormControl ( ) ) ;
94+ const error = < ValidationError > ValidationError . fromFirstError ( TestHostComponent . getFormControl ( ) ) ;
9395
9496 validationMessageComponent . show ( error ) ;
9597 expect ( validationMessageComponent . context ) . toEqual ( error . errorObject ) ;
0 commit comments