@@ -282,33 +282,33 @@ describe('uiScroll Paddings spec.', () => {
282
282
) ;
283
283
} ) ;
284
284
285
- // it('should append 3 rows via index-based applyUpdates when min/max indicies are set', () => {
286
- // runTest(Object.assign({}, scrollSettings, { startIndex: 28 }),
287
- // (viewport, scope) => {
288
- // const newItems = [
289
- // 'item' + (datasource.max + 1),
290
- // 'item' + (datasource.max + 2),
291
- // 'item' + (datasource.max + 3)
292
- // ];
293
- // const oldMax = datasource.max;
294
- // const _scrollTop = viewport.scrollTop();
295
-
296
- // datasource.minIndex = datasource.min ;
297
- // datasource.maxIndex = datasource.max ;
298
-
299
- // insertItems(datasource, datasource.max, newItems);
300
- // scope.adapter.applyUpdates(oldMax, ['item' + oldMax, ...newItems]);
301
-
302
- // scrollBottom(viewport);
303
- // expect(viewport.scrollTop()).toBe(_scrollTop + newItems.length * itemHeight);
304
-
305
- // checkRow(viewport, 1, (datasource.max - 0) + ': ' + newItems[2], true);
306
- // checkRow(viewport, 2, (datasource.max - 1) + ': ' + newItems[1], true);
307
- // checkRow(viewport, 3, (datasource.max - 2) + ': ' + newItems[0], true);
308
- // checkRow(viewport, 4, oldMax + ': item' + oldMax, true);
309
- // }
310
- // );
311
- // });
285
+ it ( 'should append 3 rows via index-based applyUpdates when min/max indicies are set' , ( ) => {
286
+ runTest ( Object . assign ( { } , scrollSettings , { startIndex : 28 } ) ,
287
+ ( viewport , scope ) => {
288
+ const newItems = [
289
+ 'item' + ( datasource . max + 1 ) ,
290
+ 'item' + ( datasource . max + 2 ) ,
291
+ 'item' + ( datasource . max + 3 )
292
+ ] ;
293
+ const oldMax = datasource . max ;
294
+
295
+ datasource . minIndex = datasource . min ;
296
+ datasource . maxIndex = datasource . max ;
297
+ const _scrollTop = viewport . scrollTop ( ) ;
298
+
299
+ insertItems ( datasource , datasource . max , newItems ) ;
300
+ scope . adapter . applyUpdates ( oldMax , [ 'item' + oldMax , ...newItems ] ) ;
301
+
302
+ scrollBottom ( viewport ) ;
303
+ expect ( viewport . scrollTop ( ) ) . toBe ( _scrollTop + newItems . length * itemHeight ) ;
304
+
305
+ checkRow ( viewport , 1 , ( datasource . max - 0 ) + ': ' + newItems [ 2 ] , true ) ;
306
+ checkRow ( viewport , 2 , ( datasource . max - 1 ) + ': ' + newItems [ 1 ] , true ) ;
307
+ checkRow ( viewport , 3 , ( datasource . max - 2 ) + ': ' + newItems [ 0 ] , true ) ;
308
+ checkRow ( viewport , 4 , oldMax + ': item' + oldMax , true ) ;
309
+ }
310
+ ) ;
311
+ } ) ;
312
312
313
313
} ) ;
314
314
0 commit comments