Skip to content

Commit

Permalink
Fixing bug in the ActionBar more menu items not including button type (
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan authored Sep 7, 2023
1 parent 0578f36 commit 70a8336
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/eleven-pillows-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@primer/view-components': patch
---

Fixing ActionBar more menu items including buttons with no type

<!-- Changed components: Primer::Alpha::ActionBar -->
2 changes: 0 additions & 2 deletions app/components/primer/alpha/action_bar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ def with_menu_item(id:, **system_arguments, &block)
system_arguments = {
**system_arguments,
hidden: true,
tag: :button,
type: "button",
"data-for": id,
"data-action": "click:action-bar#menuItemClick"
}
Expand Down
19 changes: 19 additions & 0 deletions test/components/alpha/action_bar_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

require "components/test_helper"

module Primer
module Alpha
class ActionBarTest < Minitest::Test
include Primer::ComponentTestHelpers

def test_renders_action_menu_items_with_type_button
render_preview(:default)

assert_selector("action-menu[data-target=\"action-bar.moreMenu\"]", visible: :hidden) do
assert_selector("button[type=\"button\"]")
end
end
end
end
end

0 comments on commit 70a8336

Please sign in to comment.