@@ -188,6 +188,11 @@ describe('VirtualRepeat Integration', () => {
188188 let hiddenVirtualRepeat ;
189189 let hiddenViewModel ;
190190
191+ let containerComponent ;
192+ let containerCreate ;
193+ let containerVirtualRepeat ;
194+ let containerViewModel ;
195+
191196 beforeEach ( ( ) => {
192197 items = [ ] ;
193198 for ( let i = 0 ; i < 1000 ; ++ i ) {
@@ -214,11 +219,25 @@ describe('VirtualRepeat Integration', () => {
214219 hiddenVirtualRepeat = hiddenComponent . sut ;
215220 hiddenViewModel = hiddenComponent . viewModel ;
216221 } ) ;
222+
223+ containerComponent = StageComponent
224+ . withResources ( 'src/virtual-repeat' )
225+ . inView ( `<div id="scrollContainer2" style="height: 500px; overflow-y: scroll;">
226+ <div style="height: ${ itemHeight } px;" virtual-repeat.for="item of items">\${item}</div>
227+ </div>` )
228+ . boundTo ( { items : items } ) ;
229+
230+ containerCreate = containerComponent . create ( ) . then ( ( ) => {
231+ containerVirtualRepeat = containerComponent . sut ;
232+ containerViewModel = containerComponent . viewModel ;
233+ spyOn ( containerVirtualRepeat , '_onScroll' ) . and . callThrough ( ) ;
234+ } ) ;
217235 } ) ;
218236
219237 afterEach ( ( ) => {
220238 component . cleanUp ( ) ;
221239 hiddenComponent . cleanUp ( ) ;
240+ containerComponent . cleanUp ( ) ;
222241 } ) ;
223242
224243 describe ( 'handles delete' , ( ) => {
@@ -326,6 +345,15 @@ describe('VirtualRepeat Integration', () => {
326345 } ) ;
327346 } ) ;
328347 } ) ;
348+
349+ it ( 'handles scrolling to bottom' , done => {
350+ containerCreate . then ( ( ) => {
351+ validateScroll ( containerVirtualRepeat , containerViewModel , ( ) => {
352+ expect ( containerVirtualRepeat . _onScroll ) . toHaveBeenCalled ( ) ;
353+ done ( ) ;
354+ } , 'scrollContainer2' )
355+ } ) ;
356+ } ) ;
329357 } ) ;
330358
331359 describe ( 'iterating table' , ( ) => {
0 commit comments