]> git.openstreetmap.org Git - rails.git/commitdiff
Make teaspoon UI usable
authorMarwin Hochfelsner <50826859+hlfan@users.noreply.github.com>
Mon, 21 Apr 2025 18:24:03 +0000 (20:24 +0200)
committerMarwin Hochfelsner <50826859+hlfan@users.noreply.github.com>
Mon, 21 Apr 2025 18:24:03 +0000 (20:24 +0200)
test/javascripts/osm_test.js

index 5ab92adf7ff3e227fd0c548f1eccd5c2a247bcaf..10d562959f39bd5a0d9a7284a5b8a1a5764b5162 100644 (file)
@@ -220,14 +220,15 @@ describe("OSM", function () {
 
   describe(".locationCookie", function () {
     it("creates a location cookie value", function () {
 
   describe(".locationCookie", function () {
     it("creates a location cookie value", function () {
-      $("body").html($("<div id='map'>"));
+      $("body").append("<div id='map'>");
       const map = new L.OSM.Map("map", { center: [57.6247, -3.6845], zoom: 9 });
       map.updateLayers("");
       expect(OSM.locationCookie(map)).to.eq("-3.685|57.625|9|M");
       const map = new L.OSM.Map("map", { center: [57.6247, -3.6845], zoom: 9 });
       map.updateLayers("");
       expect(OSM.locationCookie(map)).to.eq("-3.685|57.625|9|M");
+      $("#map").remove();
     });
 
     it("respects zoomPrecision", function () {
     });
 
     it("respects zoomPrecision", function () {
-      $("body").html($("<div id='map'>"));
+      $("body").append("<div id='map'>");
       const map = new L.OSM.Map("map", { center: [57.6247, -3.6845], zoom: 9 });
       map.updateLayers("");
       expect(OSM.locationCookie(map)).to.eq("-3.685|57.625|9|M");
       const map = new L.OSM.Map("map", { center: [57.6247, -3.6845], zoom: 9 });
       map.updateLayers("");
       expect(OSM.locationCookie(map)).to.eq("-3.685|57.625|9|M");
@@ -235,6 +236,7 @@ describe("OSM", function () {
       // using map._zoom here to update the zoom level manually
       map._zoom = 5;
       expect(OSM.locationCookie(map)).to.eq("-3.68|57.62|5|M");
       // using map._zoom here to update the zoom level manually
       map._zoom = 5;
       expect(OSM.locationCookie(map)).to.eq("-3.68|57.62|5|M");
+      $("#map").remove();
     });
   });
 
     });
   });