Skip to content

Commit 0149ed3

Browse files
committed
fix UT
1 parent 2e81faa commit 0149ed3

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

test/leaflet/overlay/GraphicLayerSpec.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ describe('leaflet_GraphicLayer', function () {
1313
testDiv.style.width = "500px";
1414
testDiv.style.height = "500px";
1515
window.document.body.appendChild(testDiv);
16+
17+
map = L.map('map', {
18+
preferCanvas: true,
19+
crs: L.CRS.EPSG4326,
20+
center: {lon: 0, lat: 0},
21+
maxZoom: 18,
22+
zoom: 1
23+
});
24+
L.supermap.tiledMapLayer(url).addTo(map);
1625
});
1726
beforeEach(function () {
1827
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
@@ -22,19 +31,11 @@ describe('leaflet_GraphicLayer', function () {
2231
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
2332
});
2433
afterAll(function () {
25-
map.remove();
2634
window.document.body.removeChild(testDiv);
35+
map.remove();
2736
});
2837

2938
it('initialize', function (done) {
30-
map = L.map('map', {
31-
preferCanvas: true,
32-
crs: L.CRS.EPSG4326,
33-
center: {lon: 0, lat: 0},
34-
maxZoom: 18,
35-
zoom: 1
36-
});
37-
L.supermap.tiledMapLayer(url).addTo(map);
3839
var colorCount = 5, count = 5;
3940
var graphics = [];
4041
var e = 45;
@@ -65,6 +66,7 @@ describe('leaflet_GraphicLayer', function () {
6566
}
6667
var isContainsPoint = graphicLayer._containsPoint();
6768
expect(isContainsPoint).not.toBe("false");
69+
map.removeLayer(graphicLayer);
6870
done();
6971
}, 1000)
7072
});

0 commit comments

Comments
 (0)