From 9442f2d209d431348708c07cf3a0705895229e24 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 31 Oct 2013 20:28:02 +0100 Subject: [PATCH] Test that ol.Collection#extend fires events --- test/spec/ol/collection.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/spec/ol/collection.test.js b/test/spec/ol/collection.test.js index 3020ba0f36..82992d607f 100644 --- a/test/spec/ol/collection.test.js +++ b/test/spec/ol/collection.test.js @@ -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]); + }); }); });