From: Anton Khorev Date: Thu, 19 Dec 2024 02:22:54 +0000 (+0300) Subject: Get note text only from textarea within left sidebar X-Git-Tag: live~76^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/25e4a80760d29d6026df5b5fa3f2ac121dcfe957 Get note text only from textarea within left sidebar --- diff --git a/app/assets/javascripts/index/note.js b/app/assets/javascripts/index/note.js index 8687321c9..e9c51f9bf 100644 --- a/app/assets/javascripts/index/note.js +++ b/app/assets/javascripts/index/note.js @@ -61,7 +61,7 @@ OSM.Note = function (map) { }; if (name !== "subscribe" && name !== "unsubscribe" && name !== "reopen") { - ajaxSettings.data = { text: $("textarea").val() }; + ajaxSettings.data = { text: content.find("textarea").val() }; } content.find("button[name]").prop("disabled", true); diff --git a/test/system/resolve_note_test.rb b/test/system/resolve_note_test.rb index 90990dcbd..f9152d99b 100644 --- a/test/system/resolve_note_test.rb +++ b/test/system/resolve_note_test.rb @@ -9,6 +9,7 @@ class ResolveNoteTest < ApplicationSystemTestCase within_sidebar do assert_button "Resolve" + assert_no_button "Comment & Resolve" assert_no_button "Reactivate" click_on "Resolve" @@ -17,6 +18,28 @@ class ResolveNoteTest < ApplicationSystemTestCase end end + test "can resolve an open note with a comment" do + note = create(:note_with_comments) + user = create(:user) + sign_in_as(user) + visit note_path(note) + + within_sidebar do + assert_button "Resolve" + assert_no_button "Comment & Resolve" + assert_no_button "Reactivate" + + fill_in "text", :with => "Note resolve text" + + assert_button "Comment & Resolve" + + click_on "Comment & Resolve" + + assert_content "Resolved note ##{note.id}" + assert_content "Note resolve text" + end + end + test "can reactivate a closed note" do note = create(:note_with_comments, :closed) user = create(:user) @@ -25,6 +48,7 @@ class ResolveNoteTest < ApplicationSystemTestCase within_sidebar do assert_no_button "Resolve" + assert_no_button "Comment & Resolve" assert_button "Reactivate" click_on "Reactivate"