mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(collectionRepeat): properly display collection repeat inside a modal
This commit is contained in:
@@ -152,6 +152,24 @@ describe('collectionRepeat directive', function() {
|
||||
expect(scrollView.resize.callCount).toBe(1);
|
||||
});
|
||||
|
||||
it('should rerender on modal popup', function() {
|
||||
inject(function($rootScope) {
|
||||
var el = setup('collection-repeat="item in items" collection-item-height="50"');
|
||||
var scrollView = el.controller('$ionicScroll').scrollView;
|
||||
spyOn(scrollView, 'resize');
|
||||
dataSource.setData.reset();
|
||||
repeatManager.resize.reset();
|
||||
|
||||
el.scope().items = [1, 2, 3];
|
||||
|
||||
$rootScope.$broadcast('modal.shown');
|
||||
|
||||
expect(dataSource.setData).toHaveBeenCalledWith(el.scope().items);
|
||||
expect(repeatManager.resize.callCount).toBe(1);
|
||||
expect(scrollView.resize.callCount).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
it('$destroy', function() {
|
||||
var el = setup('collection-repeat="item in items" collection-item-height="50"');
|
||||
dataSource.destroy = jasmine.createSpy('dataSourceDestroy');
|
||||
|
||||
Reference in New Issue
Block a user