Add tests for issue_note_with_author

This commit is contained in:
Alexander Meindl 2023-01-23 14:27:21 +01:00
parent 28171c326c
commit 51109b29b4
3 changed files with 21 additions and 1 deletions

View File

@ -17,6 +17,7 @@ issue_auto_assign_status: ''
issue_change_status_in_sidebar: 0
issue_current_user_status: 0
issue_freezed_with_close: 0
issue_note_with_author: 0
issue_status_change: 0
issue_status_x: ''
issue_status_y: ''

View File

@ -150,7 +150,7 @@ module Additionals
end
def addtionals_textarea_cols(text, min: 8, max: 20)
[[min, text.to_s.length / 50].max, max].min
RedminePluginKit.textarea_cols text, min: min, max: max
end
def title_with_fontawesome(title, symbole, wrapper = 'span')

View File

@ -199,4 +199,23 @@ class IssuesControllerTest < Additionals::ControllerTest
assert_select '.new-ticket-message', count: 0
end
end
def test_show_author_badge
with_plugin_settings 'additionals', issue_note_with_author: 1 do
get :show, params: { id: 1 }
assert_response :success
assert_select '#tab-content-history #note-1 .badge-author', count: 0
assert_select '#tab-content-history #note-2 .badge-author'
end
end
def test_do_not_show_author_badge_if_disabled
with_plugin_settings 'additionals', issue_note_with_author: 0 do
get :show, params: { id: 1 }
assert_response :success
assert_select 'h4.note-header .badge-author', count: 0
end
end
end