Allows plugins to add custom SVG icons for menu items added by the plugin (#23980).

Patch by Takenori TAKAKI (user:takenory).

git-svn-id: https://svn.redmine.org/redmine/trunk@23234 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2024-11-10 15:54:34 +00:00
parent 0f7e321078
commit d8fa577550
3 changed files with 21 additions and 2 deletions

View File

@@ -42,6 +42,17 @@ class Redmine::MenuManager::MenuHelperTest < Redmine::HelperTest
assert_select("a.testing", "This is a test")
end
def test_render_single_menu_node_with_plugin_icon
node = Redmine::MenuManager::MenuItem.new(:testing, '/test', { :icon => 'plugin_icon_name',:plugin => 'test_plugin_name' })
@output_buffer = render_single_menu_node(node, 'This is a test', node.url, false)
assert_select("a.testing", "This is a test") do
assert_select("svg.icon-svg") do
assert_select("use[href=?]", "/assets/plugin_assets/test_plugin_name/icons.svg#icon--plugin_icon_name")
end
end
end
def test_render_menu_node
single_node = Redmine::MenuManager::MenuItem.new(:single_node, '/test', {})
@output_buffer = render_menu_node(single_node, nil)