File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,6 +41,21 @@ def test_accepts_custom_menu_id_for_sub_menus
4141 assert_selector ( "anchored-position[id='foobarbaz-overlay'][anchor=foobarbaz-button]" )
4242 end
4343
44+ def test_accepts_divider_for_sub_menus
45+ render_inline ( Primer ::Alpha ::ActionMenu . new ) do |component |
46+ component . with_sub_menu_item ( label : "Sub-menu" , menu_id : "foobarbaz" ) do |sub_menu |
47+ sub_menu . with_item ( label : "Hello, world" )
48+ sub_menu . with_divider
49+ sub_menu . with_item ( label : "How are you doing?" )
50+ end
51+ end
52+
53+ assert_selector ( "button[id='foobarbaz-button'][aria-haspopup='true']" , text : "Sub-menu" )
54+ assert_selector ( "ul[id='foobarbaz-list'][aria-labelledby='foobarbaz-button'][role='menu']" , visible : false )
55+ assert_selector ( "anchored-position[id='foobarbaz-overlay'][anchor=foobarbaz-button]" )
56+ assert_selector ( "li[class='ActionList-sectionDivider'][role=presentation]" )
57+ end
58+
4459 def test_falls_back_to_button_if_disallowed_tag_is_given
4560 without_fetch_or_fallback_raises do
4661 render_inline Primer ::Alpha ::ActionMenu . new ( menu_id : "bad-menu" ) do |component |
You can’t perform that action at this time.
0 commit comments