Skip to content

Commit

Permalink
Complete unit tests for new geo models & coll'ns
Browse files Browse the repository at this point in the history
Issues #2180 and #2189
  • Loading branch information
robyngit committed Oct 18, 2023
1 parent f7d6ddf commit e24b8c6
Show file tree
Hide file tree
Showing 8 changed files with 556 additions and 24 deletions.
11 changes: 7 additions & 4 deletions src/js/collections/maps/GeoPoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ define(["backbone", "models/maps/GeoPoint"], function (Backbone, GeoPoint) {
*/
removePoint(indexOrPoint) {
if (typeof indexOrPoint === "number") {
this.removePointByIndex(indexOrPoint);
return this.removePointByIndex(indexOrPoint);
} else if (Array.isArray(indexOrPoint)) {
this.removePointByAttr(indexOrPoint);
return this.removePointByAttr(indexOrPoint);
} else {
// try just removing the point
return this.remove(indexOrPoint);
}
},

Expand Down Expand Up @@ -157,10 +160,10 @@ define(["backbone", "models/maps/GeoPoint"], function (Backbone, GeoPoint) {
if (!forceAsPolygon && geometryType === "Polygon" && this.length < 3) {
geometryType = this.length === 1 ? "Point" : "LineString";
}
const czml = [this.getCZMLHeader()];
let czml = [this.getCZMLHeader()];
switch (geometryType) {
case "Point":
czml.concat(this.toCZMLPoints());
czml = czml.concat(this.toCZMLPoints());
break;
case "LineString":
czml.push(this.getCZMLLineString());
Expand Down
12 changes: 6 additions & 6 deletions test/config/tests.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"unit": [
"./js/specs/unit/collections/maps/GeoPoints.spec.js",
"./js/specs/unit/models/connectors/GeoPoints-Cesium.spec.js",
"./js/specs/unit/models/connectors/GeoPoints-CesiumPoints.spec.js",
"./js/specs/unit/models/connectors/GeoPoints-CesiumPolygon.spec.js",
"./js/specs/unit/models/maps/GeoBoundingBox.spec.js",
"./js/specs/unit/models/maps/GeoUtilities.spec.js",
"./js/specs/unit/collections/SolrResults.spec.js",
"./js/specs/unit/models/Search.spec.js",
"./js/specs/unit/models/filters/Filter.spec.js",
Expand All @@ -31,6 +25,12 @@
"./js/specs/unit/collections/maps/Geohashes.spec.js",
"./js/specs/unit/models/maps/GeoPoint.spec.js",
"./js/specs/unit/models/maps/GeoScale.spec.js",
"./js/specs/unit/collections/maps/GeoPoints.spec.js",
"./js/specs/unit/models/connectors/GeoPoints-Cesium.spec.js",
"./js/specs/unit/models/connectors/GeoPoints-CesiumPoints.spec.js",
"./js/specs/unit/models/connectors/GeoPoints-CesiumPolygon.spec.js",
"./js/specs/unit/models/maps/GeoBoundingBox.spec.js",
"./js/specs/unit/models/maps/GeoUtilities.spec.js",
"./js/specs/unit/models/maps/MapInteraction.spec.js",
"./js/specs/unit/models/connectors/Filters-Map.spec.js",
"./js/specs/unit/models/connectors/Filters-Search.spec.js",
Expand Down
Loading

0 comments on commit e24b8c6

Please sign in to comment.