@@ -129,11 +129,47 @@ describe("sub_button_wheel - Integration Tests", () => {
129129
130130 // Verify wheel menu size matches button size
131131 expect ( wheelMenu . style . width ) . toBe ( "36px" ) ;
132+ expect ( wheelMenu . style . height ) . toBe ( "36px" ) ;
132133
133134 // Verify overlay is positioned correctly (before wheel menu in DOM)
134135 const overlay = document . querySelector ( ".wheel-overlay" ) ;
135136 expect ( overlay . nextElementSibling ) . toBe ( wheelMenu ) ;
136137 } ) ;
138+ it ( "should remove default tap action on the wheel opener button" , ( ) => {
139+ // Setup - Basic configuration
140+ const originalButtonSelectors = [
141+ ".bubble-sub-button-1" ,
142+ ".bubble-sub-button-2" ,
143+ ".bubble-sub-button-3" ,
144+ ".bubble-sub-button-4" ,
145+ ] ;
146+ mockThis . config . sub_button_wheel = {
147+ wheel_opener : "main" ,
148+ wheel_buttons : [ { sub_button : "1" } , { sub_button : "2" } , { sub_button : "3" } , { sub_button : "4" } ] ,
149+ } ;
150+
151+ // Set up main button with initial tap action to verify it gets overridden
152+ const mainButton = mockCard . querySelector ( ".bubble-icon-container" ) ;
153+ mainButton . dataset . tapAction = JSON . stringify ( { action : "toggle" , entity : "light.main" } ) ;
154+
155+ // Verify initial DOM state
156+ originalButtonSelectors . forEach ( ( selector ) => {
157+ expect ( mockCard . querySelector ( selector ) ) . toBeTruthy ( ) ;
158+ } ) ;
159+ expect ( document . querySelector ( ".wheel-menu" ) ) . toBeNull ( ) ;
160+
161+ // Verify main button initially has the tap action we set
162+ expect ( mainButton . getAttribute ( "data-tap-action" ) ) . toBe ( '{"action":"toggle","entity":"light.main"}' ) ;
163+
164+ // Exercise
165+ sub_button_wheel . call ( mockThis , mockCard , mockHass ) ;
166+
167+ // Verify
168+ const wheelMenu = document . querySelector ( ".wheel-menu" ) ;
169+ const openerButton = wheelMenu . querySelector ( ".wheel-open-button" ) ;
170+
171+ expect ( openerButton . getAttribute ( "data-tap-action" ) ) . toBe ( '{"action":"none"}' ) ;
172+ } ) ;
137173
138174 it ( "should not create wheel when no buttons are configured" , ( ) => {
139175 // Setup - Empty configuration
@@ -753,6 +789,7 @@ describe("sub_button_wheel - Integration Tests", () => {
753789 // Verify - Sub-button-1 becomes opener, others become wheel buttons
754790 const wheelMenu = document . querySelector ( ".wheel-menu" ) ;
755791 expect ( wheelMenu ) . toBeTruthy ( ) ;
792+ expect ( wheelMenu . classList ) . not . toContain ( "main-opener" ) ;
756793
757794 const openerButton = wheelMenu . querySelector ( ".wheel-open-button" ) ;
758795 expect ( openerButton ) . toBeTruthy ( ) ;
@@ -782,6 +819,7 @@ describe("sub_button_wheel - Integration Tests", () => {
782819 const wheelButtons = wheelMenu . querySelectorAll ( ".wheel-button" ) ;
783820
784821 expect ( wheelMenu ) . toBeTruthy ( ) ;
822+ expect ( wheelMenu . classList ) . toContain ( "main-opener" ) ;
785823 expect ( wheelButtons . length ) . toBe ( 2 ) ;
786824
787825 // Should use default even-circle layout with precise positioning
@@ -814,7 +852,7 @@ describe("sub_button_wheel - Integration Tests", () => {
814852 it ( "should handle partial configuration gracefully" , ( ) => {
815853 // Setup - Only layout specified, no animation config
816854 mockThis . config . sub_button_wheel = {
817- wheel_opener : "main" ,
855+ wheel_opener : "main-button " ,
818856 layout_options : {
819857 wheel_layout : "progressive-arc" ,
820858 // No double_ring_inner_count specified
@@ -844,7 +882,7 @@ describe("sub_button_wheel - Integration Tests", () => {
844882 it ( "should handle single button configuration" , ( ) => {
845883 // Setup - Only one wheel button
846884 mockThis . config . sub_button_wheel = {
847- wheel_opener : "main" ,
885+ wheel_opener : "main-button " ,
848886 wheel_buttons : [ { sub_button : "1" } ] ,
849887 } ;
850888
@@ -863,7 +901,8 @@ describe("sub_button_wheel - Integration Tests", () => {
863901 const openerButton = wheelMenu . querySelector ( ".wheel-open-button" ) ;
864902
865903 openerButton . click ( ) ;
866- expect ( wheelMenu . classList . contains ( "active" ) ) . toBe ( true ) ;
904+ expect ( wheelMenu . classList ) . toContain ( "active" ) ;
905+ expect ( wheelMenu . classList ) . toContain ( "main-opener" ) ;
867906 } ) ;
868907
869908 it ( "should handle maximum supported buttons for arc layouts" , ( ) => {
0 commit comments