X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d1dba97ac4f2a018b4ee93b4ec160c6a2df108b1..505dcde52a474219a0824f1d9ca6545e99993b42:/test/system/index_test.rb?ds=sidebyside diff --git a/test/system/index_test.rb b/test/system/index_test.rb index bb23cee60..1de18c9ed 100644 --- a/test/system/index_test.rb +++ b/test/system/index_test.rb @@ -12,10 +12,29 @@ class IndexTest < ApplicationSystemTestCase test "note included in edit link" do note = create(:note_with_comments) - visit browse_note_path(note) + visit note_path(note) assert_selector "#editanchor[href*='?note=#{note.id}#']" find("#sidebar .btn-close").click assert_no_selector "#editanchor[href*='?note=#{note.id}#']" end + + test "can navigate from hidden note to visible note" do + sign_in_as(create(:moderator_user)) + hidden_note = create(:note, :status => "hidden") + create(:note_comment, :note => hidden_note, :body => "this-is-a-hidden-note") + position = (1.003 * GeoRecord::SCALE).to_i + visible_note = create(:note, :latitude => position, :longitude => position) + create(:note_comment, :note => visible_note, :body => "this-is-a-visible-note") + + visit root_path(:anchor => "map=15/1/1") # view place of hidden note in case it is not rendered during note_path(hidden_note) + visit note_path(hidden_note) + find(".leaflet-control.control-layers .control-button").click + find("#map-ui .overlay-layers .form-check-label", :text => "Map Notes").click + visible_note_marker = find(".leaflet-marker-icon[title=this-is-a-visible-note]") + assert_selector "#sidebar", :text => "this-is-a-hidden-note" + + visible_note_marker.click + assert_selector "#sidebar", :text => "this-is-a-visible-note" + end end