Skip to content

Commit

Permalink
Fix NoMethodError when checking if ActionList::Dividers are active (
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron authored Jan 8, 2025
1 parent 09bb55c commit 1bb7ad7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-moons-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Fix `NoMethodError` when checking if `ActionList::Divider`s are active
4 changes: 4 additions & 0 deletions app/components/primer/alpha/action_list/divider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def initialize(scheme: DEFAULT_SCHEME, **system_arguments)
def call
render(Primer::BaseComponent.new(**@system_arguments)) { content }
end

def active?
false
end
end
end
end
Expand Down
1 change: 1 addition & 0 deletions test/components/alpha/action_list_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def test_raises_when_two_items_selected_under_single_select
error = assert_raises ArgumentError do
render_inline(Primer::Alpha::ActionList.new(aria: { label: "List" }, select_variant: :single)) do |component|
component.with_item(label: "Item 1", active: true)
component.with_divider
component.with_item(label: "Item 2", active: true)
end
end
Expand Down

0 comments on commit 1bb7ad7

Please sign in to comment.