Skip to content

Commit 5dc25da

Browse files
committed
fix 测试
1 parent bc2e51b commit 5dc25da

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

test/leaflet/services/AddressMatchServiceSpec.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,25 +138,26 @@ describe('leaflet_testAddressMatchService', function () {
138138
maxReturn: -1,
139139
geoDecodingRadius: 500
140140
});
141-
var GeoDecodingService = L.supermap.addressMatchService(addressMatchURL, options).decode(GeoDecodingParams, function (result) {
141+
var geoDecodingService = L.supermap.addressMatchService(addressMatchURL, options);
142+
geoDecodingService.decode(GeoDecodingParams, function (result) {
142143
serviceResult = result
143144
});
144145
setTimeout(function () {
145146
try {
146-
expect(GeoDecodingService).not.toBeNull();
147-
expect(GeoDecodingService.options.serverType).toBe("iServer");
147+
expect(geoDecodingService).not.toBeNull();
148+
expect(geoDecodingService.options.serverType).toBe("iServer");
148149
expect(serviceResult.type).toBe("processCompleted");
149150
var result = serviceResult.result;
150151
expect(result).not.toBeNull();
151152
expect(result).not.toBeNull();
152153
expect(result.success).toBeFalsy();
153154
expect(result.error.code).toEqual(400);
154155
expect(result.error.errorMsg).toBe("location not valid!");
155-
GeoDecodingService.destroy();
156+
geoDecodingService.destroy();
156157
done();
157158
} catch (exception) {
158159
console.log("'failEvent:GeoDecodingLocationInvalid'案例失败:" + exception.name + ":" + exception.message);
159-
GeoDecodingService.destroy();
160+
geoDecodingService.destroy();
160161
expect(false).toBeTruthy();
161162
done();
162163
}

test/leaflet/services/ThemeServiceSpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ describe('leaflet_testThemeService', function () {
333333
dataSourceNames: ["World"]
334334
});
335335
var themeLableService = L.supermap.themeService(WorldURL, options);
336-
themeGridRangeService.getThemeInfo(themeLableParameters, function (result) {
336+
themeLableService.getThemeInfo(themeLableParameters, function (result) {
337337
serviceResult = result
338338
});
339339
setTimeout(function () {
@@ -394,7 +394,7 @@ describe('leaflet_testThemeService', function () {
394394
themes: [themeRange]
395395
});
396396
var themeRangeService = L.supermap.themeService(ChinaURL, options);
397-
themeGridRangeService.getThemeInfo(themeRangeParameters, function (result) {
397+
themeRangeService.getThemeInfo(themeRangeParameters, function (result) {
398398
serviceResult = result
399399
});
400400
setTimeout(function () {
@@ -454,7 +454,7 @@ describe('leaflet_testThemeService', function () {
454454
themes: [themeUnique]
455455
});
456456
var themeUniqueService = L.supermap.themeService(ChinaURL, options);
457-
themeGridRangeService.getThemeInfo(themeUniqueParameters, function (result) {
457+
themeUniqueService.getThemeInfo(themeUniqueParameters, function (result) {
458458
serviceResult = result
459459
});
460460
setTimeout(function () {

test/openlayers/control/ChangeTileVersionSpec.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,24 @@ describe('openlayers_testChangeTileVersion', function () {
9292
var options = {
9393
orientation: "horizontal"
9494
};
95-
var changetileversion = new ol.supermap.control.ChangeTileVersion(options);
96-
var result = changetileversion.setLayer(baseLayer);
97-
expect(result).not.toBeNull();
98-
expect(result.firstLoad).toBeTruthy();
99-
expect(result.options.collapsed).toBeTruthy();
100-
expect(result.options.switch).toBeTruthy();
101-
expect(result.options.orientation).toBe("horizontal");
102-
expect(result.options.title).toBe("切换缓存版本");
103-
expect(result.options.tooltip).toBe("top");
95+
var changeTileVersion = new ol.supermap.control.ChangeTileVersion(options);
96+
changeTileVersion.setLayer(baseLayer);
97+
expect(changeTileVersion).not.toBeNull();
98+
expect(changeTileVersion.firstLoad).toBeTruthy();
99+
expect(changeTileVersion.options.collapsed).toBeTruthy();
100+
expect(changeTileVersion.options.switch).toBeTruthy();
101+
expect(changeTileVersion.options.orientation).toBe("horizontal");
102+
expect(changeTileVersion.options.title).toBe("切换缓存版本");
103+
expect(changeTileVersion.options.tooltip).toBe("top");
104104
});
105105

106106
it("removeLayer", function () {
107107
var options = {
108108
orientation: "horizontal"
109109
};
110-
var changetileversion = new ol.supermap.control.ChangeTileVersion(options);
111-
var result = changetileversion.removeLayer();
112-
expect(result.options.layer).toBeNull();
110+
var changeTileVersion = new ol.supermap.control.ChangeTileVersion(options);
111+
changeTileVersion.removeLayer();
112+
expect(changeTileVersion.options.layer).toBeNull();
113113
});
114114

115115
it("tilesVersion", function () {

0 commit comments

Comments
 (0)