@@ -13,7 +13,7 @@ import {
1313 QueryList ,
1414} from '@angular/core' ;
1515import { Direction , Directionality } from '@angular/cdk/bidi' ;
16- import { OverlayContainer , Overlay } from '@angular/cdk/overlay' ;
16+ import { OverlayContainer } from '@angular/cdk/overlay' ;
1717import { ESCAPE , LEFT_ARROW , RIGHT_ARROW } from '@angular/cdk/keycodes' ;
1818import {
1919 MAT_MENU_DEFAULT_OPTIONS ,
@@ -25,7 +25,7 @@ import {
2525 MenuPositionY ,
2626 MatMenuItem ,
2727} from './index' ;
28- import { MENU_PANEL_TOP_PADDING , MAT_MENU_SCROLL_STRATEGY } from './menu-trigger' ;
28+ import { MENU_PANEL_TOP_PADDING } from './menu-trigger' ;
2929import { MatRipple } from '@angular/material/core' ;
3030import {
3131 dispatchKeyboardEvent ,
@@ -35,8 +35,6 @@ import {
3535 createMouseEvent ,
3636 dispatchFakeEvent ,
3737} from '@angular/cdk/testing' ;
38- import { Subject } from 'rxjs/Subject' ;
39- import { ScrollDispatcher } from '@angular/cdk/scrolling' ;
4038
4139
4240describe ( 'MatMenu' , ( ) => {
@@ -244,42 +242,6 @@ describe('MatMenu', () => {
244242 expect ( document . activeElement ) . toBe ( panel , 'Expected the panel to be focused.' ) ;
245243 } ) ;
246244
247- it ( 'should close the menu when using the CloseScrollStrategy' , fakeAsync ( ( ) => {
248- const scrolledSubject = new Subject ( ) ;
249-
250- TestBed
251- . resetTestingModule ( )
252- . configureTestingModule ( {
253- imports : [ MatMenuModule , NoopAnimationsModule ] ,
254- declarations : [ SimpleMenu , FakeIcon ] ,
255- providers : [
256- {
257- provide : ScrollDispatcher ,
258- useFactory : ( ) => ( { scrolled : ( ) => scrolledSubject } )
259- } ,
260- {
261- provide : MAT_MENU_SCROLL_STRATEGY ,
262- deps : [ Overlay ] ,
263- useFactory : ( overlay : Overlay ) => ( ) => overlay . scrollStrategies . close ( )
264- }
265- ]
266- } ) ;
267-
268- const fixture = TestBed . createComponent ( SimpleMenu ) ;
269- const trigger = fixture . componentInstance . trigger ;
270-
271- fixture . detectChanges ( ) ;
272- trigger . openMenu ( ) ;
273- fixture . detectChanges ( ) ;
274-
275- expect ( trigger . menuOpen ) . toBe ( true ) ;
276-
277- scrolledSubject . next ( ) ;
278- tick ( 500 ) ;
279-
280- expect ( trigger . menuOpen ) . toBe ( false ) ;
281- } ) ) ;
282-
283245 describe ( 'positions' , ( ) => {
284246 let fixture : ComponentFixture < PositionedMenu > ;
285247 let panel : HTMLElement ;
0 commit comments