1 # frozen_string_literal: true
 
   3 require "application_system_test_case"
 
   5 class BrowseCommentLinksTest < ApplicationSystemTestCase
 
   6   test "visiting changeset comment link should pan to changeset" do
 
   7     changeset = create(:changeset, :bbox => [30, 60, 30, 60])
 
   8     comment = create(:changeset_comment, :changeset => changeset, :body => "Linked changeset comment")
 
  10     visit changeset_path(changeset, :anchor => "c#{comment.id}")
 
  13       assert_text "Linked changeset comment"
 
  15     assert_match %r{map=\d+/60\.\d+/30\.\d+}, current_url
 
  18   test "visiting note comment link should pan to note" do
 
  19     note = create(:note, :latitude => 59 * GeoRecord::SCALE, :longitude => 29 * GeoRecord::SCALE)
 
  20     create(:note_comment, :note => note, :body => "Note description")
 
  21     comment = create(:note_comment, :note => note, :body => "Linked note comment", :event => "commented")
 
  23     visit note_path(note, :anchor => "c#{comment.id}")
 
  26       assert_text "Linked note comment"
 
  28     assert_match %r{map=\d+/59\.\d+/29\.\d+}, current_url