11import { Directionality } from '@angular/cdk/bidi' ;
22import { A , ESCAPE } from '@angular/cdk/keycodes' ;
3- import { OverlayContainer } from '@angular/cdk/overlay' ;
3+ import { OverlayContainer , ScrollStrategy } from '@angular/cdk/overlay' ;
44import { ViewportRuler } from '@angular/cdk/scrolling' ;
55import { dispatchKeyboardEvent } from '@angular/cdk/testing' ;
6+ import { Location } from '@angular/common' ;
7+ import { SpyLocation } from '@angular/common/testing' ;
68import {
79 Component ,
810 Directive ,
@@ -22,10 +24,9 @@ import {
2224 TestBed ,
2325 tick ,
2426} from '@angular/core/testing' ;
25- import { Location } from '@angular/common' ;
26- import { SpyLocation } from '@angular/common/testing' ;
2727import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
28- import { MatBottomSheet , MAT_BOTTOM_SHEET_DEFAULT_OPTIONS } from './bottom-sheet' ;
28+
29+ import { MAT_BOTTOM_SHEET_DEFAULT_OPTIONS , MatBottomSheet } from './bottom-sheet' ;
2930import { MAT_BOTTOM_SHEET_DATA , MatBottomSheetConfig } from './bottom-sheet-config' ;
3031import { MatBottomSheetModule } from './bottom-sheet-module' ;
3132import { MatBottomSheetRef } from './bottom-sheet-ref' ;
@@ -405,6 +406,17 @@ describe('MatBottomSheet', () => {
405406 expect ( overlayContainerElement . querySelector ( 'mat-bottom-sheet-container' ) ) . toBeTruthy ( ) ;
406407 } ) ) ;
407408
409+ it ( 'should be able to attach a custom scroll strategy' , fakeAsync ( ( ) => {
410+ const scrollStrategy : ScrollStrategy = {
411+ attach : ( ) => { } ,
412+ enable : jasmine . createSpy ( 'scroll strategy enable spy' ) ,
413+ disable : ( ) => { }
414+ } ;
415+
416+ bottomSheet . open ( PizzaMsg , { scrollStrategy} ) ;
417+ expect ( scrollStrategy . enable ) . toHaveBeenCalled ( ) ;
418+ } ) ) ;
419+
408420 describe ( 'passing in data' , ( ) => {
409421 it ( 'should be able to pass in data' , ( ) => {
410422 const config = {
0 commit comments