Skip to content

Commit e672c69

Browse files
committed
fix UT
1 parent 0149ed3 commit e672c69

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/leaflet/overlay/GraphicLayerSpec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ describe('leaflet_GraphicLayer', function () {
3131
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
3232
});
3333
afterAll(function () {
34+
//canvas渲染时由于Path 相关的子类 -> map.remove()会有重绘操作,从而引起刷新延迟会报错,故弃之
35+
map.off();
36+
map = null;
3437
window.document.body.removeChild(testDiv);
35-
map.remove();
3638
});
3739

3840
it('initialize', function (done) {
@@ -58,6 +60,7 @@ describe('leaflet_GraphicLayer', function () {
5860
});
5961
}
6062
var graphicLayer = L.supermap.graphicLayer(graphics).addTo(map);
63+
6164
setTimeout(function () {
6265
expect(graphicLayer.graphics.length).toEqual(count);
6366
for (var i = 0; i < graphicLayer.graphics.length; i++) {
@@ -66,7 +69,7 @@ describe('leaflet_GraphicLayer', function () {
6669
}
6770
var isContainsPoint = graphicLayer._containsPoint();
6871
expect(isContainsPoint).not.toBe("false");
69-
map.removeLayer(graphicLayer);
72+
graphicLayer.remove();
7073
done();
7174
}, 1000)
7275
});

0 commit comments

Comments
 (0)