From 97cdf42730e21c8f2dd350252e4737bc99ad584f Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Fri, 2 May 2025 03:44:43 +0200 Subject: [PATCH] Generalize leaflet-marker-icon selector --- test/system/account_home_test.rb | 16 ++++++++-------- test/system/dashboard_test.rb | 2 +- test/system/note_layer_test.rb | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/system/account_home_test.rb b/test/system/account_home_test.rb index 813c45ec8..e8130e4f5 100644 --- a/test/system/account_home_test.rb +++ b/test/system/account_home_test.rb @@ -6,16 +6,16 @@ class AccountHomeTest < ApplicationSystemTestCase sign_in_as(user) visit root_path - assert_no_selector "img.leaflet-marker-icon" + assert_no_selector ".leaflet-marker-icon" click_on "test user" click_on "Go to Home Location" - all "img.leaflet-marker-icon", :count => 1 do |marker| + all ".leaflet-marker-icon", :count => 1 do |marker| assert_equal "My home location", marker["title"] end click_on "OpenStreetMap logo" - assert_no_selector "img.leaflet-marker-icon" + assert_no_selector ".leaflet-marker-icon" end test "Go to Home Location works on non-map layout pages" do @@ -23,16 +23,16 @@ class AccountHomeTest < ApplicationSystemTestCase sign_in_as(user) visit about_path - assert_no_selector "img.leaflet-marker-icon" + assert_no_selector ".leaflet-marker-icon" click_on "test user" click_on "Go to Home Location" - all "img.leaflet-marker-icon", :count => 1 do |marker| + all ".leaflet-marker-icon", :count => 1 do |marker| assert_equal "My home location", marker["title"] end click_on "OpenStreetMap logo" - assert_no_selector "img.leaflet-marker-icon" + assert_no_selector ".leaflet-marker-icon" end test "Go to Home Location is not available for users without home location" do @@ -40,7 +40,7 @@ class AccountHomeTest < ApplicationSystemTestCase sign_in_as(user) visit root_path - assert_no_selector "img.leaflet-marker-icon" + assert_no_selector ".leaflet-marker-icon" click_on "test user" assert_no_link "Go to Home Location" @@ -51,7 +51,7 @@ class AccountHomeTest < ApplicationSystemTestCase sign_in_as(user) visit account_home_path - assert_no_selector "img.leaflet-marker-icon" + assert_no_selector ".leaflet-marker-icon" assert_text "Home location is not set" end end diff --git a/test/system/dashboard_test.rb b/test/system/dashboard_test.rb index 9df3e208c..6647fb026 100644 --- a/test/system/dashboard_test.rb +++ b/test/system/dashboard_test.rb @@ -60,7 +60,7 @@ class DashboardSystemTest < ApplicationSystemTestCase assert_no_text "Your location" assert_no_link "Fred Tester" - find("img.leaflet-marker-icon").click + find(".leaflet-marker-icon").click assert_text "Your location" assert_link "Fred Tester" diff --git a/test/system/note_layer_test.rb b/test/system/note_layer_test.rb index ae9403203..5758eb4c6 100644 --- a/test/system/note_layer_test.rb +++ b/test/system/note_layer_test.rb @@ -8,7 +8,7 @@ class NoteLayerTest < ApplicationSystemTestCase end visit root_path(:anchor => "map=18/1.1/1.1&layers=N") - all "img.leaflet-marker-icon", :count => 1 do |marker| + all ".leaflet-marker-icon", :count => 1 do |marker| assert_equal "Note description", marker["title"] end end @@ -21,7 +21,7 @@ class NoteLayerTest < ApplicationSystemTestCase end visit root_path(:anchor => "map=18/1.1/1.1&layers=N") - all "img.leaflet-marker-icon", :count => 1 do |marker| + all ".leaflet-marker-icon", :count => 1 do |marker| assert_equal "", marker["title"] end end @@ -33,7 +33,7 @@ class NoteLayerTest < ApplicationSystemTestCase end visit root_path(:anchor => "map=18/1.1/1.1&layers=N") - all "img.leaflet-marker-icon", :count => 1 do |marker| + all ".leaflet-marker-icon", :count => 1 do |marker| assert_equal "", marker["title"] end end -- 2.39.5