@@ -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
@@ -2689,24 +2689,24 @@ describe('MdSelect', () => {
26892689 expect ( component . control . invalid ) . toBe ( false ) ;
26902690 expect ( component . select . _isErrorState ( ) ) . toBe ( false ) ;
26912691
2692- customErrorFixture . componentInstance . errorStateMatcher = matcher ;
2692+ customErrorFixture . componentInstance . errorStateMatcher = { match : matcher } ;
26932693 customErrorFixture . detectChanges ( ) ;
26942694
26952695 expect ( component . select . _isErrorState ( ) ) . toBe ( true ) ;
26962696 expect ( matcher ) . toHaveBeenCalled ( ) ;
26972697 } ) ;
26982698
26992699 it ( 'should be able to override the error matching behavior via the injection token' , ( ) => {
2700- const errorOptions : ErrorOptions = {
2701- isErrorState : jasmine . createSpy ( 'error state matcher' ) . and . returnValue ( true )
2700+ const errorOptions : ErrorStateMatcher = {
2701+ match : jasmine . createSpy ( 'error state matcher' ) . and . returnValue ( true )
27022702 } ;
27032703
27042704 fixture . destroy ( ) ;
27052705
27062706 TestBed . resetTestingModule ( ) . configureTestingModule ( {
27072707 imports : [ MdSelectModule , ReactiveFormsModule , FormsModule , NoopAnimationsModule ] ,
27082708 declarations : [ SelectInsideFormGroup ] ,
2709- providers : [ { provide : ErrorOptions , useValue : errorOptions } ] ,
2709+ providers : [ { provide : ErrorStateMatcher , useValue : errorOptions } ] ,
27102710 } ) ;
27112711
27122712 const errorFixture = TestBed . createComponent ( SelectInsideFormGroup ) ;
@@ -2715,7 +2715,7 @@ describe('MdSelect', () => {
27152715 errorFixture . detectChanges ( ) ;
27162716
27172717 expect ( component . select . _isErrorState ( ) ) . toBe ( true ) ;
2718- expect ( errorOptions . errorStateMatcher ) . toHaveBeenCalled ( ) ;
2718+ expect ( errorOptions . match ) . toHaveBeenCalled ( ) ;
27192719 } ) ;
27202720 } ) ;
27212721
@@ -3272,6 +3272,6 @@ class CustomErrorBehaviorSelect {
32723272 { value : 'steak-0' , viewValue : 'Steak' } ,
32733273 { value : 'pizza-1' , viewValue : 'Pizza' } ,
32743274 ] ;
3275- errorStateMatcher = ( ) => false ;
3275+ errorStateMatcher : ErrorStateMatcher ;
32763276}
32773277
0 commit comments