Fix up hotkeys

ref: https://fizzy.37signals.com/5986089/collections/2/cards/1452
This commit is contained in:
Mike Dalessio
2025-08-28 11:47:21 -04:00
parent 28c4cc7cee
commit 5f4ee049c6
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ module HotkeysHelper
platform.mac? ? "return" : "enter"
else
key
end
end.join()
end.capitalize
end.join("+").gsub(/\+/, "")
end
end
+5 -5
View File
@@ -12,31 +12,31 @@ class HotkeysHelperTest < ActionView::TestCase
test "linux modifier key" do
emulate_linux
assert_equal "ctrlJ", hotkey_label([ "ctrl", "J" ])
assert_equal "Ctrl+J", hotkey_label([ "ctrl", "J" ])
end
test "mac enter" do
emulate_mac
assert_equal "returnJ", hotkey_label([ "enter", "J" ])
assert_equal "Return+J", hotkey_label([ "enter", "J" ])
end
test "linux enter" do
emulate_linux
assert_equal "enterJ", hotkey_label([ "enter", "J" ])
assert_equal "Enter+J", hotkey_label([ "enter", "J" ])
end
test "mac hyper" do
emulate_mac
assert_equal "hyperJ", hotkey_label([ "hyper", "J" ])
assert_equal "Hyper+J", hotkey_label([ "hyper", "J" ])
end
test "linux hyper" do
emulate_linux
assert_equal "hyperJ", hotkey_label([ "hyper", "J" ])
assert_equal "Hyper+J", hotkey_label([ "hyper", "J" ])
end
private