summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-18 15:28:30 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-18 15:28:30 +0200
commit6b6e50909cc77de1797e88be5445c5b643b008a9 (patch)
tree3b72081f0ae4428c1c346c267681115d42e22855 /test
parent49de2e14972030a7ef0ca36a94ab55a23a2f3596 (diff)
Give action log entries per-verb icons
A muted glyph before each sentence makes both log surfaces scannable by verb: create, publish, move, trash, restore, destroy, and the discard pair. Rollback publishes get their own icon (history) distinct from ordinary promotion. Unknown verbs fall back to a dashed circle.
Diffstat (limited to 'test')
-rw-r--r--test/models/helpers/node_actions_helper_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/models/helpers/node_actions_helper_test.rb b/test/models/helpers/node_actions_helper_test.rb
index ef6035d..1b72ec9 100644
--- a/test/models/helpers/node_actions_helper_test.rb
+++ b/test/models/helpers/node_actions_helper_test.rb
@@ -10,6 +10,10 @@ class NodeActionsHelperTest < ActionView::TestCase
10 { :locale => nil } 10 { :locale => nil }
11 end 11 end
12 12
13 def icon(_name, **)
14 '<svg class="stub-icon"></svg>'.html_safe
15 end
16
13 def teardown 17 def teardown
14 I18n.locale = @original_locale 18 I18n.locale = @original_locale
15 end 19 end
@@ -133,4 +137,10 @@ class NodeActionsHelperTest < ActionView::TestCase
133 137
134 assert_equal "", revision_lifecycle_badges(nil) 138 assert_equal "", revision_lifecycle_badges(nil)
135 end 139 end
140
141 test "verb icons map known verbs, distinguish rollbacks, and fall back" do
142 assert_includes verb_icon(entry("trash", { "path" => { "from" => "a", "to" => "t/a" } })), "node_action_icon--trash"
143 assert_includes verb_icon(entry("publish", { "via" => "revision" })), "node_action_icon--history"
144 assert_includes verb_icon(entry("frobnicate")), "node_action_icon--circle-dashed"
145 end
136end 146end