feat(settings): rename negative settings to positive naming (disable* -> enable*) (#14142)

Co-authored-by: jacob314 <jacob314@gmail.com>
This commit is contained in:
Alexander Farber
2026-01-16 23:33:49 +01:00
committed by GitHub
parent f2d3b76389
commit 608da23393
25 changed files with 785 additions and 243 deletions

View File

@@ -14,7 +14,6 @@ import EventEmitter from 'node:events';
import type { ChildProcess } from 'node:child_process';
import { handleAutoUpdate, setUpdateHandler } from './handleAutoUpdate.js';
import { MessageType } from '../ui/types.js';
import { mergeSettings } from '../config/settings.js';
vi.mock('./installationInfo.js', async () => {
const actual = await vi.importActual('./installationInfo.js');
@@ -50,9 +49,16 @@ describe('handleAutoUpdate', () => {
message: 'An update is available!',
};
const defaultMergedSettings = mergeSettings({}, {}, {}, {}, true);
mockSettings = {
merged: defaultMergedSettings,
merged: {
general: {
enableAutoUpdate: true,
enableAutoUpdateNotification: true,
},
tools: {
sandbox: false,
},
},
} as LoadedSettings;
mockChildProcess = Object.assign(new EventEmitter(), {
@@ -79,8 +85,8 @@ describe('handleAutoUpdate', () => {
expect(mockSpawn).not.toHaveBeenCalled();
});
it('should do nothing if update nag is disabled', () => {
mockSettings.merged.general.disableUpdateNag = true;
it('should do nothing if update prompts are disabled', () => {
mockSettings.merged.general.enableAutoUpdateNotification = false;
handleAutoUpdate(mockUpdateInfo, mockSettings, '/root', mockSpawn);
expect(mockGetInstallationInfo).not.toHaveBeenCalled();
expect(updateEventEmitter.emit).not.toHaveBeenCalled();
@@ -88,7 +94,7 @@ describe('handleAutoUpdate', () => {
});
it('should emit "update-received" but not update if auto-updates are disabled', () => {
mockSettings.merged.general.disableAutoUpdate = true;
mockSettings.merged.general.enableAutoUpdate = false;
mockGetInstallationInfo.mockReturnValue({
updateCommand: 'npm i -g @google/gemini-cli@latest',
updateMessage: 'Please update manually.',