]> git.openstreetmap.org Git - rails.git/commitdiff
Test map centering on a node
authorAnton Khorev <tony29@yandex.ru>
Fri, 14 Mar 2025 11:42:00 +0000 (14:42 +0300)
committerAnton Khorev <tony29@yandex.ru>
Fri, 14 Mar 2025 11:42:00 +0000 (14:42 +0300)
test/system/browse_test.rb

index 15dc1cb9b53a538f71bf526b5e163b9f1502fdcc..3faf3b75fdd2960fc1ac1c1d8adc43de57e81305 100644 (file)
@@ -10,4 +10,14 @@ class BrowseTest < ApplicationSystemTestCase
 
     assert_selector "#map .leaflet-overlay-pane path"
   end
+
+  test "map should center on a viewed node" do
+    node = create(:node, :lat => 59.55555, :lon => 29.55555)
+
+    visit node_path(node)
+
+    find("#map [aria-label='Share']").click
+    share_url = find_by_id("long_input").value
+    assert_match %r{map=\d+/59\.\d+/29\.\d+}, share_url
+  end
 end