@@ -15,6 +15,7 @@ import {MdAutocomplete} from './autocomplete';
1515import { MdInputContainer } from '../input/input-container' ;
1616import { Observable } from 'rxjs/Observable' ;
1717import { dispatchFakeEvent } from '../core/testing/dispatch-events' ;
18+ import { typeInElement } from '../core/testing/type-in-element' ;
1819
1920import 'rxjs/add/operator/map' ;
2021
@@ -786,7 +787,7 @@ describe('MdAutocomplete', () => {
786787 fixture . whenStable ( ) . then ( ( ) => {
787788 fixture . detectChanges ( ) ;
788789 expect ( input . getAttribute ( 'aria-expanded' ) )
789- . toBe ( 'false' , 'Expected aria-expanded to be false when panel hides itself.' ) ;
790+ . toBe ( 'false' , 'Expected aria-expanded to be false when panel hides itself.' ) ;
790791 } ) ;
791792 } ) ;
792793 } ) ;
@@ -1072,18 +1073,6 @@ class AutocompleteWithNgModel {
10721073
10731074}
10741075
1075- /**
1076- * Focuses an input, sets its value and dispatches
1077- * the `input` event, simulating the user typing.
1078- * @param value Value to be set on the input.
1079- * @param element Element onto which to set the value.
1080- */
1081- function typeInElement ( value : string , element : HTMLInputElement , autoFocus = true ) {
1082- element . focus ( ) ;
1083- element . value = value ;
1084- dispatchFakeEvent ( element , 'input' ) ;
1085- }
1086-
10871076/** This is a mock keyboard event to test keyboard events in the autocomplete. */
10881077class MockKeyboardEvent {
10891078 constructor ( public keyCode : number ) { }
0 commit comments