updated /quit to use new slash command arch (#4259)

Co-authored-by: Abhi <abhipatel@google.com>
This commit is contained in:
Harold Mciver
2025-07-16 22:40:56 -04:00
committed by GitHub
parent 01e66bb123
commit 9ab44ea9d6
8 changed files with 120 additions and 99 deletions

View File

@@ -25,6 +25,7 @@ import { compressCommand } from '../ui/commands/compressCommand.js';
import { mcpCommand } from '../ui/commands/mcpCommand.js';
import { editorCommand } from '../ui/commands/editorCommand.js';
import { bugCommand } from '../ui/commands/bugCommand.js';
import { quitCommand } from '../ui/commands/quitCommand.js';
// Mock the command modules to isolate the service from the command implementations.
vi.mock('../ui/commands/memoryCommand.js', () => ({
@@ -75,9 +76,12 @@ vi.mock('../ui/commands/editorCommand.js', () => ({
vi.mock('../ui/commands/bugCommand.js', () => ({
bugCommand: { name: 'bug', description: 'Mock Bug' },
}));
vi.mock('../ui/commands/quitCommand.js', () => ({
quitCommand: { name: 'quit', description: 'Mock Quit' },
}));
describe('CommandService', () => {
const subCommandLen = 16;
const subCommandLen = 17;
let mockConfig: Mocked<Config>;
beforeEach(() => {
@@ -144,6 +148,7 @@ describe('CommandService', () => {
const commandNames = tree.map((cmd) => cmd.name);
expect(commandNames).toContain('ide');
expect(commandNames).toContain('editor');
expect(commandNames).toContain('quit');
});
it('should overwrite any existing commands when called again', async () => {
@@ -183,6 +188,7 @@ describe('CommandService', () => {
mcpCommand,
memoryCommand,
privacyCommand,
quitCommand,
statsCommand,
themeCommand,
toolsCommand,