From 6b6e50909cc77de1797e88be5445c5b643b008a9 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 18 Jul 2026 15:28:30 +0200 Subject: 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. --- test/models/helpers/node_actions_helper_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') 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 { :locale => nil } end + def icon(_name, **) + ''.html_safe + end + def teardown I18n.locale = @original_locale end @@ -133,4 +137,10 @@ class NodeActionsHelperTest < ActionView::TestCase assert_equal "", revision_lifecycle_badges(nil) end + + test "verb icons map known verbs, distinguish rollbacks, and fall back" do + assert_includes verb_icon(entry("trash", { "path" => { "from" => "a", "to" => "t/a" } })), "node_action_icon--trash" + assert_includes verb_icon(entry("publish", { "via" => "revision" })), "node_action_icon--history" + assert_includes verb_icon(entry("frobnicate")), "node_action_icon--circle-dashed" + end end -- cgit v1.3