Skip to content

Commit 6ef2de0

Browse files
author
caoxinke@supermap.com
committed
fix UT.
1 parent 15e9245 commit 6ef2de0

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

test/openlayers/mapping/ImageSuperMapRestSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ describe('openlayers_ImageSuperMapRest', function () {
7474
var coords = new ol.geom.Point(120.14, 30.24);
7575
var tileUrl = imageTileSource.tileUrlFunction(coords, pixelRatio, tempOptions);
7676
expect(tileUrl).toBe(GlobeParameter.mapServiceURL + "%E4%B8%96%E7%95%8C%E5%9C%B0%E5%9B%BE_Day/image.png?&transparent=true&cacheEnabled=false&width=256&height=256&viewBounds=%7B%22leftBottom%22%20:%20%7B%22x%22:NaN,%22y%22:NaN%7D,%22rightTop%22%20:%20%7B%22x%22:NaN,%22y%22:NaN%7D%7D");
77-
expect(imageTileSource.tileGrid.tileSize_).toEqual(256);
77+
expect(imageTileSource.getTileGrid().getTileSize()).toEqual(256);
7878
});
7979
});

test/openlayers/overlay/vectortile/VectorTileStylesSpec.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ describe('openlayers_VectorTileStyles', function () {
6363
setTimeout(function () {
6464
expect(style).not.toBeNull();
6565
expect(style.length).toEqual(1);
66-
expect(style[0].stroke_.color_).toBe("rgba(232, 212, 85, 1)");
67-
expect(style[0].stroke_.width_).toEqual(1.5118110236220474);
68-
expect(style[0].stroke_.lineJoin_).toBe("round");
69-
expect(style[0].stroke_.miterLimit_).toEqual(10);
66+
expect(style[0].getStroke().getColor()).toBe("rgba(232, 212, 85, 1)");
67+
expect(style[0].getStroke().getWidth()).toEqual(1.5118110236220474);
68+
expect(style[0].getStroke().getLineJoin()).toBe("round");
69+
expect(style[0].getStroke().getMiterLimit()).toEqual(10);
7070
vectorTileStyles = null;
7171
done();
7272
}, 1000);
@@ -161,10 +161,10 @@ describe('openlayers_VectorTileStyles', function () {
161161
setTimeout(function () {
162162
expect(style).not.toBeNull();
163163
expect(style.length).toEqual(1);
164-
expect(style[0].stroke_.color_).toBe("rgba(232, 212, 85, 1)");
165-
expect(style[0].stroke_.width_).toEqual(1.5118110236220474);
166-
expect(style[0].stroke_.lineJoin_).toBe("round");
167-
expect(style[0].stroke_.miterLimit_).toEqual(10);
164+
expect(style[0].getStroke().getColor()).toBe("rgba(232, 212, 85, 1)");
165+
expect(style[0].getStroke().getWidth()).toEqual(1.5118110236220474);
166+
expect(style[0].getStroke().getLineJoin()).toBe("round");
167+
expect(style[0].getStroke().getMiterLimit()).toEqual(10);
168168
vectorTileStyles = null;
169169
done();
170170
}, 1000);
@@ -222,10 +222,10 @@ describe('openlayers_VectorTileStyles', function () {
222222
var styleLine = vectorTileStyles.getFeatureStyle(featureLine);
223223
setTimeout(function () {
224224
expect(styleLine).not.toBeNull();
225-
expect(styleLine.stroke_.color_).toBe("rgba(232,212,85,1)");
226-
expect(styleLine.stroke_.width_).toEqual(3.77952);
227-
expect(styleLine.stroke_.lineJoin_).toBe("round");
228-
expect(styleLine.stroke_.miterLimit_).toEqual(10);
225+
expect(styleLine.getStroke().getColor()).toBe("rgba(232,212,85,1)");
226+
expect(styleLine.getStroke().getWidth()).toEqual(3.77952);
227+
expect(styleLine.getStroke().getLineJoin()).toBe("round");
228+
expect(styleLine.getStroke().getMiterLimit()).toEqual(10);
229229
}, 1000);
230230
// featureRegionJSON通过JSON.stringify((new ol.format.GeoJSON()).writeFeatureObject(feature)获得,其中feature为视野范围内背景面对象
231231
var featureRegionJSON = {
@@ -246,11 +246,11 @@ describe('openlayers_VectorTileStyles', function () {
246246
var styleRegion = vectorTileStyles.getFeatureStyle(featureRegion);
247247
setTimeout(function () {
248248
expect(styleRegion).not.toBeNull();
249-
expect(styleRegion.fill_.color_).toBe("rgba(255,255,255,1)");
250-
expect(styleRegion.stroke_.color_).toBe("rgba(120,113,102,0)");
251-
expect(styleRegion.stroke_.width_).toEqual(0.94488);
252-
expect(styleRegion.stroke_.lineJoin_).toBe("round");
253-
expect(styleRegion.stroke_.miterLimit_).toEqual(10);
249+
expect(styleRegion.getFill().getColor()).toBe("rgba(255,255,255,1)");
250+
expect(styleRegion.getStroke().getColor()).toBe("rgba(120,113,102,0)");
251+
expect(styleRegion.getStroke().getWidth()).toEqual(0.94488);
252+
expect(styleRegion.getStroke().getLineJoin()).toBe("round");
253+
expect(styleRegion.getStroke().getMiterLimit()).toEqual(10);
254254
vectorTileStyles = null;
255255
done();
256256
}, 1000);
@@ -345,10 +345,10 @@ describe('openlayers_VectorTileStyles', function () {
345345
var styleLine = vectorTileStyles.getFeatureStyle(featureLine);
346346
setTimeout(function () {
347347
expect(styleLine).not.toBeNull();
348-
expect(styleLine.stroke_.color_).toBe("rgba(232,212,85,1)");
349-
expect(styleLine.stroke_.width_).toEqual(3.77952);
350-
expect(styleLine.stroke_.lineJoin_).toBe("round");
351-
expect(styleLine.stroke_.miterLimit_).toEqual(10);
348+
expect(styleLine.getStroke().getColor()).toBe("rgba(232,212,85,1)");
349+
expect(styleLine.getStroke().getWidth()).toEqual(3.77952);
350+
expect(styleLine.getStroke().getLineJoin()).toBe("round");
351+
expect(styleLine.getStroke().getMiterLimit()).toEqual(10);
352352
}, 1000);
353353
// featureRegionJSON通过JSON.stringify((new ol.format.GeoJSON()).writeFeatureObject(feature)获得,其中feature为视野范围内背景面对象
354354
var featureRegionJSON = {
@@ -370,11 +370,11 @@ describe('openlayers_VectorTileStyles', function () {
370370
setTimeout(function () {
371371
expect(styleRegion).not.toBeNull();
372372
expect(styleRegion.length).toEqual(1);
373-
expect(styleRegion[0].fill_.color_).toBe("rgba(8, 48, 75, 1)");
374-
expect(styleRegion[0].stroke_.color_).toBe("rgba(0, 0, 0, 0)");
375-
expect(styleRegion[0].stroke_.width_).toEqual(1);
376-
expect(styleRegion[0].stroke_.lineJoin_).toBe("round");
377-
expect(styleRegion[0].stroke_.miterLimit_).toEqual(10);
373+
expect(styleRegion[0].getFill().getColor()).toBe("rgba(8, 48, 75, 1)");
374+
expect(styleRegion[0].getStroke().getColor()).toBe("rgba(0, 0, 0, 0)");
375+
expect(styleRegion[0].getStroke().getWidth()).toEqual(1);
376+
expect(styleRegion[0].getStroke().getLineJoin()).toBe("round");
377+
expect(styleRegion[0].getStroke().getMiterLimit()).toEqual(10);
378378
vectorTileStyles = null;
379379
done();
380380
}, 1000);

0 commit comments

Comments
 (0)