@@ -412,6 +412,37 @@ describe("SettingsView - Sound Settings", () => {
412412 )
413413 } )
414414
415+ it ( "saves the selected chat font size and persists null on reset" , ( ) => {
416+ const { activateTab, getSettingsContent } = renderSettingsView ( )
417+
418+ activateTab ( "ui" )
419+
420+ const content = getSettingsContent ( )
421+ const slider = within ( content ) . getByTestId ( "chat-font-size-slider" )
422+
423+ // Pick a size, then Save — the boundary should forward it to the host.
424+ fireEvent . change ( slider , { target : { value : "18" } } )
425+ fireEvent . click ( screen . getByTestId ( "save-button" ) )
426+
427+ expect ( vscode . postMessage ) . toHaveBeenCalledWith (
428+ expect . objectContaining ( {
429+ type : "updateSettings" ,
430+ updatedSettings : expect . objectContaining ( { chatFontSize : 18 } ) ,
431+ } ) ,
432+ )
433+
434+ // Reset clears the override; it is persisted as null (not undefined).
435+ fireEvent . click ( within ( getSettingsContent ( ) ) . getByTestId ( "chat-font-size-reset" ) )
436+ fireEvent . click ( screen . getByTestId ( "save-button" ) )
437+
438+ expect ( vscode . postMessage ) . toHaveBeenCalledWith (
439+ expect . objectContaining ( {
440+ type : "updateSettings" ,
441+ updatedSettings : expect . objectContaining ( { chatFontSize : null } ) ,
442+ } ) ,
443+ )
444+ } )
445+
415446 it ( "shows tts slider when sound is enabled" , ( ) => {
416447 // Render once and get the activateTab helper
417448 const { activateTab, getSettingsContent } = renderSettingsView ( )
0 commit comments