1 require "application_system_test_case"
3 class IndexTest < ApplicationSystemTestCase
4 test "node included in edit link" do
7 assert_selector "#editanchor[href*='?node=#{node.id}#']"
9 find("#sidebar .btn-close").click
10 assert_no_selector "#editanchor[href*='?node=#{node.id}#']"
13 test "note included in edit link" do
14 note = create(:note_with_comments)
16 assert_selector "#editanchor[href*='?note=#{note.id}#']"
18 find("#sidebar .btn-close").click
19 assert_no_selector "#editanchor[href*='?note=#{note.id}#']"
22 test "can navigate from hidden note to visible note" do
23 sign_in_as(create(:moderator_user))
24 hidden_note = create(:note, :status => "hidden")
25 create(:note_comment, :note => hidden_note, :body => "this-is-a-hidden-note")
26 position = (1.003 * GeoRecord::SCALE).to_i
27 visible_note = create(:note, :latitude => position, :longitude => position)
28 create(:note_comment, :note => visible_note, :body => "this-is-a-visible-note")
30 visit root_path(:anchor => "map=15/1/1") # view place of hidden note in case it is not rendered during note_path(hidden_note)
31 visit note_path(hidden_note)
32 find(".leaflet-control.control-layers .control-button").click
33 find("#map-ui .overlay-layers .form-check-label", :text => "Map Notes").click
34 visible_note_marker = find(".leaflet-marker-icon[title=this-is-a-visible-note]")
35 assert_selector "#sidebar", :text => "this-is-a-hidden-note"
37 visible_note_marker.click
38 assert_selector "#sidebar", :text => "this-is-a-visible-note"