From 39cf0ee1546e89bca7df03f90a080ffc46a1351e Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 3 Jul 2017 14:25:10 -0600 Subject: [PATCH] Avoid failure when other tests don't clean up --- test/spec/ol/control/attribution.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/spec/ol/control/attribution.test.js b/test/spec/ol/control/attribution.test.js index ca2d8d6403..daec6568bf 100644 --- a/test/spec/ol/control/attribution.test.js +++ b/test/spec/ol/control/attribution.test.js @@ -8,9 +8,9 @@ goog.require('ol.source.Tile'); describe('ol.control.Attribution', function() { - var map, target; + var map; beforeEach(function() { - target = document.createElement('div'); + var target = document.createElement('div'); target.style.width = target.style.height = '100px'; document.body.appendChild(target); map = new ol.Map({ @@ -63,13 +63,13 @@ describe('ol.control.Attribution', function() { }); afterEach(function() { - map.setTarget(null); - document.body.removeChild(target); + disposeMap(map); + map = null; }); it('does not add duplicate attributions', function() { map.renderSync(); - var attribution = document.querySelectorAll('.ol-attribution li'); + var attribution = map.getTarget().querySelectorAll('.ol-attribution li'); expect(attribution.length).to.be(3); // first
  • is the logo });