Skip to content

Commit

Permalink
fix: radio field on actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Jan 21, 2025
1 parent 041d00f commit 98c5f0e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% @field.options.each do |key, value| %>
<div>
<%= form.radio_button @field.id, key %>
<%= form.label @field.id, value: value %>
<%= form.label @field.id, value, value: value %>
</div>
<% end %>
</div>
Expand Down
1 change: 1 addition & 0 deletions spec/dummy/app/avo/actions/sub/dummy_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Avo::Actions::Sub::DummyAction < Avo::BaseAction
end

def fields
field :size, as: :radio, options: {small: "Small Option", medium: "Medium Option", large: "Large Option"}
TestBuddy.hi("Dummy action fields")
field :keep_modal_open, as: :boolean
field :persistent_text, as: :text
Expand Down
17 changes: 17 additions & 0 deletions spec/features/avo/radio_field_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,21 @@
end
end
end

describe "on actions" do
it "display options" do
visit avo.resources_users_path

expect(page).not_to have_text("Small Option")
expect(page).not_to have_text("Medium Option")
expect(page).not_to have_text("Large Option")

open_panel_action(action_name: "Dummy action")

expect(page).to have_text("Small Option")
expect(page).to have_text("Medium Option")
expect(page).to have_text("Large Option")

end
end
end

0 comments on commit 98c5f0e

Please sign in to comment.