@@ -14,10 +14,10 @@ def render_component(**opts)
1414 end
1515
1616 describe "rendering" do
17- it "renders a button tab by default" do
17+ it "renders a link tab by default" do
1818 render_component
1919
20- expect ( page ) . to have_css ( "button[type='button ']" )
20+ expect ( page ) . to have_css ( "a[href='# ']" )
2121 expect ( page ) . to have_css ( "span.tabs__item-label" , text : "Tab" )
2222 expect ( page ) . to have_css ( ".tabs__item" )
2323 expect ( page ) . to have_css ( ".tabs__item-wrapper" )
@@ -79,58 +79,56 @@ def render_component(**opts)
7979 data : { testid : "test-tab" , action : "click->tabs#select" }
8080 )
8181
82- expect ( page ) . to have_css ( "button #custom-tab-id" )
83- expect ( page ) . to have_css ( "button [title='Click to view settings']" )
82+ expect ( page ) . to have_css ( "a #custom-tab-id[href='#'] " )
83+ expect ( page ) . to have_css ( "a [title='Click to view settings']" )
8484 expect ( page ) . to have_css ( ".tabs__item.my-custom-class" )
85- expect ( page ) . to have_css ( "button [data-testid='test-tab'][data-action='click->tabs#select']" )
85+ expect ( page ) . to have_css ( "a [data-testid='test-tab'][data-action='click->tabs#select']" )
8686 end
8787 end
8888
8989 describe "disabled state" do
90- it "applies disabled attributes to button " do
90+ it "applies disabled attributes to link " do
9191 render_component ( disabled : true )
9292
93- expect ( page ) . to have_css ( "button[disabled]" )
94- expect ( page ) . to have_css ( "button[aria-disabled='true']" )
95- expect ( page ) . to have_css ( "button[tabindex='-1']" )
93+ expect ( page ) . to have_css ( "a[aria-disabled='true']" )
94+ expect ( page ) . to have_css ( "a[tabindex='-1']" )
9695 expect ( page ) . to have_css ( ".tabs__item--disabled" )
9796 end
9897
9998 it "sets tabindex to 0 when enabled" do
10099 render_component ( disabled : false )
101- expect ( page ) . to have_css ( "button [tabindex='0']" )
100+ expect ( page ) . to have_css ( "a [tabindex='0']" )
102101 end
103102 end
104103
105104 describe "ARIA attributes" do
106105 it "includes proper ARIA attributes" do
107106 render_component ( id : "my-tab" , active : true )
108107
109- expect ( page ) . to have_css ( "button [role='tab']" )
110- expect ( page ) . to have_css ( "button [aria-selected='true']" )
111- expect ( page ) . to have_css ( "button [id='my-tab']" )
112- expect ( page ) . to have_css ( "button [aria-controls]" )
108+ expect ( page ) . to have_css ( "a [role='tab']" )
109+ expect ( page ) . to have_css ( "a [aria-selected='true']" )
110+ expect ( page ) . to have_css ( "a [id='my-tab']" )
111+ expect ( page ) . to have_css ( "a [aria-controls]" )
113112 end
114113
115114 it "uses custom aria-controls when provided" do
116115 render_component ( aria_controls : "custom-panel" )
117- expect ( page ) . to have_css ( "button [aria-controls='custom-panel']" )
116+ expect ( page ) . to have_css ( "a [aria-controls='custom-panel']" )
118117 end
119118
120119 it "sets aria-selected based on active state" do
121120 render_component ( active : false )
122- expect ( page ) . to have_css ( "button [aria-selected='false']" )
121+ expect ( page ) . to have_css ( "a [aria-selected='false']" )
123122 end
124123 end
125124
126125 describe "data attributes" do
127126 it "preserves custom data attributes" do
128127 render_component ( data : { custom : "value" } )
129- expect ( page ) . to have_css ( "button [data-custom='value']" )
128+ expect ( page ) . to have_css ( "a [data-custom='value']" )
130129 end
131130 end
132131
133-
134132 describe "variants" do
135133 describe "group variant" do
136134 it "applies group variant classes" do
0 commit comments