Test that ol.Collection#extend fires events

This commit is contained in:
Tom Payne
2013-10-31 20:28:02 +01:00
parent 5af671b5f7
commit 9442f2d209

View File

@@ -270,6 +270,15 @@ describe('ol.collection', function() {
expect(collection.getAt(0)).to.eql(1);
expect(collection.getAt(1)).to.eql(2);
});
it('fires events', function() {
var collection = new ol.Collection();
var elems = [];
goog.events.listen(collection, ol.CollectionEventType.ADD, function(e) {
elems.push(e.getElement());
});
collection.extend([1, 2]);
expect(elems).to.eql([1, 2]);
});
});
});