mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(collectionRepeat): remove elements at correct time when leaving page
This commit is contained in:
@@ -70,20 +70,6 @@ describe('$collectionDataSource service', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('.destroy() should cleanup dimensions backupItemsArray and attachedItems', function() {
|
||||
var source = setup();
|
||||
source.dimensions = [1,2,3];
|
||||
source.attachedItems = {0: 'a'};
|
||||
source.backupItemsArray = ['b'];
|
||||
spyOn(source, 'destroyItem');
|
||||
source.destroy();
|
||||
expect(source.dimensions.length).toBe(0);
|
||||
expect(source.destroyItem).toHaveBeenCalledWith('a');
|
||||
expect(source.destroyItem).toHaveBeenCalledWith('b');
|
||||
expect(source.attachedItems).toEqual({});
|
||||
expect(source.backupItemsArray).toEqual([]);
|
||||
});
|
||||
|
||||
it('.calculateDataDimensions()', function() {
|
||||
function widthGetter(scope, locals) {
|
||||
return locals.$index + locals.item + 'w';
|
||||
|
||||
@@ -168,15 +168,6 @@ describe('collectionRepeatManager service', function() {
|
||||
|
||||
});
|
||||
|
||||
it('.destroy() should remove items', function() {
|
||||
var manager = setup();
|
||||
spyOn(manager, 'removeItem');
|
||||
manager.renderedItems = { '1': true, '2': true };
|
||||
manager.destroy();
|
||||
expect(manager.removeItem).toHaveBeenCalledWith('1');
|
||||
expect(manager.removeItem).toHaveBeenCalledWith('2');
|
||||
});
|
||||
|
||||
describe('.calculateDimensions()', function() {
|
||||
it('should work with 1 item per space', function() {
|
||||
var manager = setup();
|
||||
|
||||
Reference in New Issue
Block a user