@@ -31,7 +31,7 @@ import {Subject} from 'rxjs/Subject';
3131import { ViewportRuler } from '../core/overlay/position/viewport-ruler' ;
3232import { dispatchFakeEvent , dispatchKeyboardEvent , wrappedErrorMessage } from '@angular/cdk/testing' ;
3333import { ScrollDispatcher } from '../core/overlay/scroll/scroll-dispatcher' ;
34- import { ErrorOptions } from '../core/error/error-options' ;
34+ import { ErrorStateMatcher } from '../core/error/error-options' ;
3535import {
3636 FloatPlaceholderType ,
3737 MD_PLACEHOLDER_GLOBAL_OPTIONS
@@ -2674,24 +2674,24 @@ describe('MdSelect', () => {
26742674 expect ( component . control . invalid ) . toBe ( false ) ;
26752675 expect ( component . select . _isErrorState ( ) ) . toBe ( false ) ;
26762676
2677- customErrorFixture . componentInstance . errorStateMatcher = matcher ;
2677+ customErrorFixture . componentInstance . errorStateMatcher = { match : matcher } ;
26782678 customErrorFixture . detectChanges ( ) ;
26792679
26802680 expect ( component . select . _isErrorState ( ) ) . toBe ( true ) ;
26812681 expect ( matcher ) . toHaveBeenCalled ( ) ;
26822682 } ) ;
26832683
26842684 it ( 'should be able to override the error matching behavior via the injection token' , ( ) => {
2685- const errorOptions : ErrorOptions = {
2686- isErrorState : jasmine . createSpy ( 'error state matcher' ) . and . returnValue ( true )
2685+ const errorOptions : ErrorStateMatcher = {
2686+ match : jasmine . createSpy ( 'error state matcher' ) . and . returnValue ( true )
26872687 } ;
26882688
26892689 fixture . destroy ( ) ;
26902690
26912691 TestBed . resetTestingModule ( ) . configureTestingModule ( {
26922692 imports : [ MdSelectModule , ReactiveFormsModule , FormsModule , NoopAnimationsModule ] ,
26932693 declarations : [ SelectInsideFormGroup ] ,
2694- providers : [ { provide : ErrorOptions , useValue : errorOptions } ] ,
2694+ providers : [ { provide : ErrorStateMatcher , useValue : errorOptions } ] ,
26952695 } ) ;
26962696
26972697 const errorFixture = TestBed . createComponent ( SelectInsideFormGroup ) ;
@@ -2700,7 +2700,7 @@ describe('MdSelect', () => {
27002700 errorFixture . detectChanges ( ) ;
27012701
27022702 expect ( component . select . _isErrorState ( ) ) . toBe ( true ) ;
2703- expect ( errorOptions . errorStateMatcher ) . toHaveBeenCalled ( ) ;
2703+ expect ( errorOptions . match ) . toHaveBeenCalled ( ) ;
27042704 } ) ;
27052705 } ) ;
27062706
@@ -3257,6 +3257,6 @@ class CustomErrorBehaviorSelect {
32573257 { value : 'steak-0' , viewValue : 'Steak' } ,
32583258 { value : 'pizza-1' , viewValue : 'Pizza' } ,
32593259 ] ;
3260- errorStateMatcher = ( ) => false ;
3260+ errorStateMatcher : ErrorStateMatcher ;
32613261}
32623262
0 commit comments