@@ -210,7 +210,7 @@ describe("ContextManagementSettings", () => {
210210 it ( "toggles auto condense context setting" , ( ) => {
211211 const mockSetCachedStateField = jest . fn ( )
212212 const props = { ...autoCondenseProps , setCachedStateField : mockSetCachedStateField }
213- render ( < ContextManagementSettings { ...props } /> )
213+ const { rerender } = render ( < ContextManagementSettings { ...props } /> )
214214
215215 const checkbox = screen . getByTestId ( "auto-condense-context-checkbox" )
216216 expect ( checkbox ) . toBeChecked ( )
@@ -219,19 +219,22 @@ describe("ContextManagementSettings", () => {
219219 fireEvent . click ( checkbox )
220220 expect ( mockSetCachedStateField ) . toHaveBeenCalledWith ( "autoCondenseContext" , false )
221221
222+ // Re-render with updated props to simulate the state change
223+ rerender ( < ContextManagementSettings { ...props } autoCondenseContext = { false } /> )
224+
222225 // Additional settings should not be visible when disabled
223226 expect ( screen . queryByTestId ( "auto-condense-percent-slider" ) ) . not . toBeInTheDocument ( )
224- expect ( screen . queryByTestId ( "condensing-api-config-select ") ) . not . toBeInTheDocument ( )
225- expect ( screen . queryByTestId ( "custom-condensing-prompt-textarea ") ) . not . toBeInTheDocument ( )
227+ expect ( screen . queryByRole ( "combobox ") ) . not . toBeInTheDocument ( )
228+ expect ( screen . queryByRole ( "textbox ") ) . not . toBeInTheDocument ( )
226229 } )
227230
228231 it ( "shows additional settings when auto condense is enabled" , ( ) => {
229232 render ( < ContextManagementSettings { ...autoCondenseProps } /> )
230233
231234 // Additional settings should be visible
232235 expect ( screen . getByTestId ( "auto-condense-percent-slider" ) ) . toBeInTheDocument ( )
233- expect ( screen . getByTestId ( "condensing-api-config-select ") ) . toBeInTheDocument ( )
234- expect ( screen . getByTestId ( "custom-condensing-prompt-textarea ") ) . toBeInTheDocument ( )
236+ expect ( screen . getByRole ( "combobox ") ) . toBeInTheDocument ( )
237+ expect ( screen . getByRole ( "textbox ") ) . toBeInTheDocument ( )
235238 } )
236239
237240 it ( "hides additional settings when auto condense is disabled" , ( ) => {
@@ -240,8 +243,8 @@ describe("ContextManagementSettings", () => {
240243
241244 // Additional settings should not be visible
242245 expect ( screen . queryByTestId ( "auto-condense-percent-slider" ) ) . not . toBeInTheDocument ( )
243- expect ( screen . queryByTestId ( "condensing-api-config-select ") ) . not . toBeInTheDocument ( )
244- expect ( screen . queryByTestId ( "custom-condensing-prompt-textarea ") ) . not . toBeInTheDocument ( )
246+ expect ( screen . queryByRole ( "combobox ") ) . not . toBeInTheDocument ( )
247+ expect ( screen . queryByRole ( "textbox ") ) . not . toBeInTheDocument ( )
245248 } )
246249
247250 it ( "updates auto condense context percent" , ( ) => {
0 commit comments