diff options
Diffstat (limited to 'test/models')
| -rw-r--r-- | test/models/helpers/node_actions_helper_test.rb | 10 |
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 | ||
| 136 | end | 146 | end |
