Skip to content

Commit d15c902

Browse files
committed
fix UT
1 parent 21b73fe commit d15c902

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/leaflet/overlay/GraphicLayerSpec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ describe('leaflet_GraphicLayer', () => {
5656
for (var j = 0; j < count; ++j) {
5757
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
5858
graphics[j] = graphic({
59-
_latlng: L.latLng(coordinates[0], coordinates[1]),
60-
_canvas: randomCircleStyles[Math.floor(Math.random() * colorCount)].getCanvas()
59+
latLng: L.latLng(coordinates[0], coordinates[1]),
60+
style: randomCircleStyles[Math.floor(Math.random() * colorCount)].getCanvas()
6161
});
6262
}
6363
var layer = graphicLayer(graphics).addTo(map);
6464
setTimeout(() => {
6565
expect(layer.graphics.length).toEqual(count);
6666
for (var i = 0; i < layer.graphics.length; i++) {
67-
expect(layer.graphics[i]._canvas).not.toBeNull();
68-
expect(layer.graphics[i]._latlng).not.toBeNull();
67+
expect(layer.graphics[i]._style).not.toBeNull();
68+
expect(layer.graphics[i]._latLng).not.toBeNull();
6969
}
7070
var isContainsPoint = layer._containsPoint();
7171
expect(isContainsPoint).not.toBe("false");

test/leaflet/overlay/graphic/CloverStyleSpec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('leaflet_CloverStyle', () => {
6262
for (var i = 0; i < count; ++i) {
6363
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
6464
graphics[i] = graphic({
65-
latlng: L.latLng(coordinates[0], coordinates[1]),
65+
latLng: L.latLng(coordinates[0], coordinates[1]),
6666
style: clovers[Math.floor(Math.random() * randCount)].getStyle()
6767
});
6868
}
@@ -73,9 +73,9 @@ describe('leaflet_CloverStyle', () => {
7373
expect(layer.graphics.length).toEqual(count);
7474
for (var i = 0; i < layer.graphics.length; i++) {
7575
expect(layer.graphics[i]._style).not.toBeNull();
76-
expect(layer.graphics[i]._latlng).not.toBeNull();
77-
expect(layer.graphics[i]._latlng.lat).not.toBeNull();
78-
expect(layer.graphics[i]._latlng.lng).not.toBeNull();
76+
expect(layer.graphics[i]._latLng).not.toBeNull();
77+
expect(layer.graphics[i]._latLng.lat).not.toBeNull();
78+
expect(layer.graphics[i]._latLng.lng).not.toBeNull();
7979
}
8080
//map.remove()时,canvas渲染的场景下render会先移除canvas的ctx,而path的移除会有重绘操作。
8181
//从而引起刷新延迟会报错,故在此移除重绘

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy