@@ -119,7 +119,7 @@ describe("ContextManagementSettings", () => {
119119 render ( < ContextManagementSettings { ...defaultProps } includeDiagnosticMessages = { true } /> )
120120
121121 const checkbox = screen . getByTestId ( "include-diagnostic-messages-checkbox" )
122- expect ( checkbox . querySelector ( "input" ) ) . toBeChecked ( )
122+ expect ( checkbox ) . toHaveAttribute ( "data-state" , "checked" )
123123
124124 const slider = screen . getByTestId ( "max-diagnostic-messages-slider" )
125125 expect ( slider ) . toBeInTheDocument ( )
@@ -130,7 +130,7 @@ describe("ContextManagementSettings", () => {
130130 render ( < ContextManagementSettings { ...defaultProps } includeDiagnosticMessages = { false } /> )
131131
132132 const checkbox = screen . getByTestId ( "include-diagnostic-messages-checkbox" )
133- expect ( checkbox . querySelector ( "input" ) ) . not . toBeChecked ( )
133+ expect ( checkbox ) . toHaveAttribute ( "data-state" , "unchecked" )
134134
135135 // Slider should still be rendered when diagnostics are disabled
136136 expect ( screen . getByTestId ( "max-diagnostic-messages-slider" ) ) . toBeInTheDocument ( )
@@ -141,7 +141,7 @@ describe("ContextManagementSettings", () => {
141141 const setCachedStateField = vi . fn ( )
142142 render ( < ContextManagementSettings { ...defaultProps } setCachedStateField = { setCachedStateField } /> )
143143
144- const checkbox = screen . getByTestId ( "include-diagnostic-messages-checkbox" ) . querySelector ( "input" ) !
144+ const checkbox = screen . getByTestId ( "include-diagnostic-messages-checkbox" )
145145 fireEvent . click ( checkbox )
146146
147147 await waitFor ( ( ) => {
@@ -332,7 +332,7 @@ describe("ContextManagementSettings", () => {
332332 // Always full read checkbox
333333 const alwaysFullReadCheckbox = screen . getByTestId ( "max-read-file-always-full-checkbox" )
334334 expect ( alwaysFullReadCheckbox ) . toBeInTheDocument ( )
335- expect ( alwaysFullReadCheckbox ) . not . toBeChecked ( )
335+ expect ( alwaysFullReadCheckbox ) . toHaveAttribute ( "data-state" , "unchecked" )
336336 } )
337337
338338 it ( "updates max read file line setting" , ( ) => {
@@ -399,8 +399,7 @@ describe("ContextManagementSettings", () => {
399399 render ( < ContextManagementSettings { ...props } /> )
400400
401401 const checkbox = screen . getByTestId ( "auto-condense-context-checkbox" )
402- const input = checkbox . querySelector ( 'input[type="checkbox"]' )
403- expect ( input ) . toBeChecked ( )
402+ expect ( checkbox ) . toHaveAttribute ( "data-state" , "checked" )
404403
405404 // Toggle off
406405 fireEvent . click ( checkbox )
@@ -445,8 +444,7 @@ describe("ContextManagementSettings", () => {
445444 render ( < ContextManagementSettings { ...propsWithMaxReadFileLine } /> )
446445
447446 const checkbox = screen . getByTestId ( "max-read-file-always-full-checkbox" )
448- const input = checkbox . querySelector ( 'input[type="checkbox"]' )
449- expect ( input ) . toBeChecked ( )
447+ expect ( checkbox ) . toHaveAttribute ( "data-state" , "checked" )
450448 } )
451449
452450 it ( "handles boundary values for sliders" , ( ) => {
@@ -507,7 +505,7 @@ describe("ContextManagementSettings", () => {
507505 expect ( input ) . toHaveValue ( - 1 )
508506 expect ( input ) . not . toBeDisabled ( ) // Input is not disabled when maxReadFileLine is undefined (only when explicitly set to -1)
509507 expect ( checkbox ) . toBeInTheDocument ( )
510- expect ( checkbox ) . not . toBeChecked ( ) // Checkbox is not checked when maxReadFileLine is undefined (only when explicitly set to -1)
508+ expect ( checkbox ) . toHaveAttribute ( "data-state" , "unchecked" ) // Checkbox is not checked when maxReadFileLine is undefined (only when explicitly set to -1)
511509 } )
512510 } )
513511
0 commit comments