diff --git a/.changeset/cyan-moons-run.md b/.changeset/cyan-moons-run.md new file mode 100644 index 0000000000..8328f4eed4 --- /dev/null +++ b/.changeset/cyan-moons-run.md @@ -0,0 +1,5 @@ +--- +'@primer/view-components': patch +--- + +Fix `NoMethodError` when checking if `ActionList::Divider`s are active diff --git a/app/components/primer/alpha/action_list/divider.rb b/app/components/primer/alpha/action_list/divider.rb index ce5b3a3373..e959bbafe9 100644 --- a/app/components/primer/alpha/action_list/divider.rb +++ b/app/components/primer/alpha/action_list/divider.rb @@ -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 diff --git a/test/components/alpha/action_list_test.rb b/test/components/alpha/action_list_test.rb index 643071c788..e8818cb6e0 100644 --- a/test/components/alpha/action_list_test.rb +++ b/test/components/alpha/action_list_test.rb @@ -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