@@ -44,30 +44,6 @@ def test_required_adds_class_to_label
4444 assert_selector "label.required"
4545 end
4646
47- def test_renders_well_formed_html_structure
48- render_inline ( ComboboxComponent . new (
49- form : build_form ,
50- method : :combobox_field ,
51- label : "Choose fruit" ,
52- collection : simple_collection ,
53- item_value_method : :value ,
54- item_label_method : :label
55- ) )
56-
57- doc = Nokogiri ::HTML5 . fragment ( rendered_content , max_errors : -1 )
58- assert_empty doc . errors , "Expected no HTML parse errors, got: #{ doc . errors . map ( &:to_s ) . join ( "\n " ) } "
59-
60- # The list dropdown must be a sibling of the input row's flex wrapper,
61- # not nested inside it — otherwise the popover renders inside the input.
62- list = doc . css ( "ul" ) . find { |n | n . attributes . key? ( "x-combobox:list" ) }
63- refute_nil list , "expected an x-combobox:list <ul>"
64- parent_classes = list . parent [ "class" ] . to_s . split
65- assert_includes parent_classes , "relative"
66- assert_includes parent_classes , "mt-cfa-sm"
67- refute_includes parent_classes , "flex" ,
68- "x-combobox:list <ul> must not be nested inside the input's flex wrapper"
69- end
70-
7147 def test_item_disabled_method_marks_options_disabled
7248 collection = [
7349 OpenStruct . new ( value : "yes" , label : "Yes" , unavailable : false ) ,
0 commit comments