Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kendallgassner authored Feb 6, 2025
1 parent db0a033 commit f0d643c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/lib/primer/forms/action_menu_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# frozen_string_literal: true

require "lib/test_helper"
require_relative "models/trip"

class Primer::Forms::ActionMenuTest < Minitest::Test
include Primer::ComponentTestHelpers

def test_label_aria_describes_button
render_in_view_context do
primer_form_with(url: "/foo") do |f|
render_inline_form(f) do |action_menu_form|
action_menu_form.action_menu(name: "city", label: "Favorite city", caption: "Select your favorite!") do |city_list|
city_list.with_item(label: "Lopez Island", data: { value: "lopez_island" }) do |item|
item.with_leading_visual_icon(icon: :log)
end
city_list.with_item(label: "Bellevue", data: { value: "bellevue" }) do |item|
item.with_leading_visual_icon(icon: :paste)
end
city_list.with_item(label: "Seattle", data: { value: "seattle" }) do |item|
item.with_leading_visual_icon(icon: :"device-camera")
end
end
end
end
end

assert_selector "button[aria-describedby='Favorite city']"
end


end

0 comments on commit f0d643c

Please sign in to comment.