Skip to content

Commit a0fb76b

Browse files
committed
【fix】UT review by luoxiao
1 parent 4fa6c46 commit a0fb76b

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

test/openlayers/mapping/ImageSuperMapRestSpec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ describe('openlayers_ImageSuperMapRest', () => {
5858
expect(imageTileOptions.serverType).toBe('ISERVER');
5959
expect(imageTileOptions.crossOrigin).toBe('anonymous');
6060
expect(imageTileSource).not.toBeNull();
61-
expect(imageTileSource.urls.length).toBe(1);
6261
done();
6362
} catch (exception) {
6463
console.log("'initialize'案例失败:" + exception.name + ':' + exception.message);

test/openlayers/mapping/TileSuperMapRestSpec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ describe('openlayers_TileSuperMapRest', () => {
2727
var tileSource = new TileSuperMapRest(tileOptions);
2828
expect(tileSource.options).not.toBeNull();
2929
expect(tileSource.options.serverType).toBe('ISERVER');
30-
expect(tileSource.urls.length).toBe(1);
3130
});
3231

3332
it('tileUrlFunction', () => {

test/openlayers/overlay/VectorTileSuperMapRestSpec_mapboxstyle.js renamed to test/openlayers/overlay/VectorTileSuperMapRestMapboxstyleSpec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import {
33
} from '../../../src/openlayers/overlay/VectorTileSuperMapRest';
44
import {
55
FetchRequest
6-
} from '../../../src/common/util/FetchRequest';
6+
} from '@supermap/iclient-common/util/FetchRequest';
77
import Map from 'ol/Map';
88
import View from 'ol/View';
99
import MVT from 'ol/format/MVT';
1010
import Feature from 'ol/Feature';
1111
import VectorTileLayer from 'ol/layer/VectorTile';
1212

13-
describe('openlayers_VectorTileSuperMapRest', () => {
13+
describe('openlayers_VectorTileSuperMapRest_mapboxStyle', () => {
1414
var url = GlobeParameter.californiaURL
1515
var originalTimeout;
1616
var testDiv, map, vectorLayer;
@@ -71,9 +71,9 @@ describe('openlayers_VectorTileSuperMapRest', () => {
7171
format: format
7272
})
7373
});
74-
spyOn(vectorLayer.getSource(), 'tileUrlFunction').and.callThrough();
74+
spyOn(vectorLayer.getSource(), 'tileLoadFunction').and.callThrough();
7575
setTimeout(() => {
76-
expect(vectorLayer.getSource().tileUrlFunction.calls.count()).toEqual(8)
76+
expect(vectorLayer.getSource().tileLoadFunction.calls.count()).toEqual(4)
7777
done();
7878
}, 2000);
7979
map.addLayer(vectorLayer);
@@ -92,10 +92,10 @@ describe('openlayers_VectorTileSuperMapRest', () => {
9292
format: format
9393
})
9494
});
95-
spyOn(vectorLayer.getSource(), 'tileUrlFunction').and.callThrough();
95+
spyOn(vectorLayer.getSource(), 'tileLoadFunction').and.callThrough();
9696
setTimeout(() => {
9797
expect(vectorLayer.getSource()._tileUrl).toContain("California");
98-
expect(vectorLayer.getSource().tileUrlFunction.calls.count()).toEqual(8)
98+
expect(vectorLayer.getSource().tileLoadFunction.calls.count()).toEqual(4)
9999
done();
100100
}, 2000);
101101
map.addLayer(vectorLayer);

test/openlayers/overlay/VectorTileSuperMapRestSpec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ describe('openlayers_VectorTileSuperMapRest', () => {
5050
expect(vectorTileOptions.serverType).toBe("ISERVER");
5151
expect(vectorTileOptions.crossOrigin).toBe("anonymous");
5252
expect(vectorTileSource).not.toBeNull();
53-
expect(vectorTileSource.urls.length).toBe(1);
5453
done();
5554
} catch (exception) {
5655
console.log("'initialize'案例失败:" + exception.name + ":" + exception.message);

test/test-main-openlayers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import './openlayers/overlay/MapvSpec.js';
2323
import './openlayers/overlay/RangeSpec.js';
2424
import './openlayers/overlay/RankSymbolSpec.js';
2525
import './openlayers/overlay/UniqueSpec.js';
26-
import './openlayers/overlay/VectorTileSuperMapRestSpec_mapboxstyle.js';
26+
import './openlayers/overlay/VectorTileSuperMapRestMapboxstyleSpec.js';
2727
import './openlayers/overlay/VectorTileSuperMapRestSpec.js';
2828
import './openlayers/overlay/theme/GeoFeatureSpec.js';
2929
import './openlayers/overlay/theme/ThemeFeatureSpec.js';

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