@@ -13,9 +13,11 @@ import { describe, expect, it, vi } from "vitest";
1313import type { AppSettings , WorkspaceInfo } from "@/types" ;
1414import {
1515 connectWorkspace ,
16+ getAppBuildType ,
1617 getAgentsSettings ,
1718 getConfigModel ,
1819 getExperimentalFeatureList ,
20+ isMobileRuntime ,
1921 getModelList ,
2022 listWorkspaces ,
2123} from "@services/tauri" ;
@@ -34,22 +36,28 @@ vi.mock("@services/tauri", async () => {
3436 return {
3537 ...actual ,
3638 connectWorkspace : vi . fn ( ) ,
39+ getAppBuildType : vi . fn ( ) ,
3740 getModelList : vi . fn ( ) ,
3841 getConfigModel : vi . fn ( ) ,
3942 getExperimentalFeatureList : vi . fn ( ) ,
4043 getAgentsSettings : vi . fn ( ) ,
44+ isMobileRuntime : vi . fn ( ) ,
4145 listWorkspaces : vi . fn ( ) ,
4246 } ;
4347} ) ;
4448
4549const connectWorkspaceMock = vi . mocked ( connectWorkspace ) ;
50+ const getAppBuildTypeMock = vi . mocked ( getAppBuildType ) ;
4651const getConfigModelMock = vi . mocked ( getConfigModel ) ;
4752const getModelListMock = vi . mocked ( getModelList ) ;
4853const getExperimentalFeatureListMock = vi . mocked ( getExperimentalFeatureList ) ;
4954const getAgentsSettingsMock = vi . mocked ( getAgentsSettings ) ;
55+ const isMobileRuntimeMock = vi . mocked ( isMobileRuntime ) ;
5056const listWorkspacesMock = vi . mocked ( listWorkspaces ) ;
5157connectWorkspaceMock . mockResolvedValue ( undefined ) ;
58+ getAppBuildTypeMock . mockResolvedValue ( "release" ) ;
5259getConfigModelMock . mockResolvedValue ( null ) ;
60+ isMobileRuntimeMock . mockResolvedValue ( false ) ;
5361listWorkspacesMock . mockResolvedValue ( [ ] ) ;
5462getAgentsSettingsMock . mockResolvedValue ( {
5563 configPath : "/Users/me/.codex/config.toml" ,
@@ -105,6 +113,7 @@ const baseSettings: AppSettings = {
105113 showMessageFilePath : true ,
106114 chatHistoryScrollbackItems : 200 ,
107115 threadTitleAutogenerationEnabled : false ,
116+ automaticAppUpdateChecksEnabled : true ,
108117 uiFontFamily :
109118 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' ,
110119 codeFontFamily :
@@ -266,6 +275,50 @@ const renderComposerSection = (
266275 return { onUpdateAppSettings } ;
267276} ;
268277
278+ const renderAboutSection = (
279+ options : {
280+ appSettings ?: Partial < AppSettings > ;
281+ onUpdateAppSettings ?: ComponentProps < typeof SettingsView > [ "onUpdateAppSettings" ] ;
282+ } = { } ,
283+ ) => {
284+ cleanup ( ) ;
285+ const onUpdateAppSettings =
286+ options . onUpdateAppSettings ?? vi . fn ( ) . mockResolvedValue ( undefined ) ;
287+ const props : ComponentProps < typeof SettingsView > = {
288+ reduceTransparency : false ,
289+ onToggleTransparency : vi . fn ( ) ,
290+ appSettings : { ...baseSettings , ...options . appSettings } ,
291+ openAppIconById : { } ,
292+ onUpdateAppSettings,
293+ workspaceGroups : [ ] ,
294+ groupedWorkspaces : [ ] ,
295+ ungroupedLabel : "Ungrouped" ,
296+ onClose : vi . fn ( ) ,
297+ onMoveWorkspace : vi . fn ( ) ,
298+ onDeleteWorkspace : vi . fn ( ) ,
299+ onCreateWorkspaceGroup : vi . fn ( ) . mockResolvedValue ( null ) ,
300+ onRenameWorkspaceGroup : vi . fn ( ) . mockResolvedValue ( null ) ,
301+ onMoveWorkspaceGroup : vi . fn ( ) . mockResolvedValue ( null ) ,
302+ onDeleteWorkspaceGroup : vi . fn ( ) . mockResolvedValue ( null ) ,
303+ onAssignWorkspaceGroup : vi . fn ( ) . mockResolvedValue ( null ) ,
304+ onRunDoctor : vi . fn ( ) . mockResolvedValue ( createDoctorResult ( ) ) ,
305+ onUpdateWorkspaceSettings : vi . fn ( ) . mockResolvedValue ( undefined ) ,
306+ scaleShortcutTitle : "Scale shortcut" ,
307+ scaleShortcutText : "Use Command +/-" ,
308+ onTestNotificationSound : vi . fn ( ) ,
309+ onTestSystemNotification : vi . fn ( ) ,
310+ dictationModelStatus : null ,
311+ onDownloadDictationModel : vi . fn ( ) ,
312+ onCancelDictationDownload : vi . fn ( ) ,
313+ onRemoveDictationModel : vi . fn ( ) ,
314+ } ;
315+
316+ render ( < SettingsView { ...props } /> ) ;
317+ fireEvent . click ( screen . getByRole ( "button" , { name : "About" } ) ) ;
318+
319+ return { onUpdateAppSettings } ;
320+ } ;
321+
269322const renderFeaturesSection = (
270323 options : {
271324 appSettings ?: Partial < AppSettings > ;
@@ -672,6 +725,30 @@ describe("SettingsView Display", () => {
672725 } ) ;
673726} ) ;
674727
728+ describe ( "SettingsView About" , ( ) => {
729+ it ( "toggles automatic app update checks" , async ( ) => {
730+ const onUpdateAppSettings = vi . fn ( ) . mockResolvedValue ( undefined ) ;
731+ renderAboutSection ( {
732+ onUpdateAppSettings,
733+ appSettings : { automaticAppUpdateChecksEnabled : false } ,
734+ } ) ;
735+
736+ const row = screen
737+ . getByText ( "Automatically check for app updates" )
738+ . closest ( ".settings-toggle-row" ) as HTMLElement | null ;
739+ if ( ! row ) {
740+ throw new Error ( "Expected automatic app update checks row" ) ;
741+ }
742+ fireEvent . click ( within ( row ) . getByRole ( "button" ) ) ;
743+
744+ await waitFor ( ( ) => {
745+ expect ( onUpdateAppSettings ) . toHaveBeenCalledWith (
746+ expect . objectContaining ( { automaticAppUpdateChecksEnabled : true } ) ,
747+ ) ;
748+ } ) ;
749+ } ) ;
750+ } ) ;
751+
675752describe ( "SettingsView Environments" , ( ) => {
676753 it ( "saves the setup script for the selected project" , async ( ) => {
677754 const onUpdateWorkspaceSettings = vi . fn ( ) . mockResolvedValue ( undefined ) ;
0 commit comments