Skip to content

Commit a04cc8f

Browse files
committed
Add a test
1 parent 5b454d0 commit a04cc8f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

packages/cli/src/gemini.test.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,4 +639,40 @@ describe('startInteractiveUI', () => {
639639
await new Promise((resolve) => setTimeout(resolve, 0));
640640
expect(checkForUpdates).toHaveBeenCalledTimes(1);
641641
});
642+
643+
it('should not call checkForUpdates when disableUpdateNag is true', async () => {
644+
const { checkForUpdates } = await import('./ui/utils/updateCheck.js');
645+
646+
const settingsWithNagDisabled = {
647+
merged: {
648+
general: {
649+
disableUpdateNag: true,
650+
},
651+
ui: {
652+
hideWindowTitle: false,
653+
},
654+
},
655+
} as LoadedSettings;
656+
657+
const mockInitializationResult = {
658+
authError: null,
659+
themeError: null,
660+
shouldOpenAuthDialog: false,
661+
geminiMdFileCount: 0,
662+
};
663+
664+
await startInteractiveUI(
665+
mockConfig,
666+
settingsWithNagDisabled,
667+
mockStartupWarnings,
668+
mockWorkspaceRoot,
669+
mockInitializationResult,
670+
);
671+
672+
// Wait for any async operations
673+
await new Promise((resolve) => setTimeout(resolve, 0));
674+
675+
// checkForUpdates should NOT be called when disableUpdateNag is true
676+
expect(checkForUpdates).not.toHaveBeenCalled();
677+
});
642678
});

0 commit comments

Comments
 (0)