update /tools to new slash command arch (#4236)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: matt korwel <matt.korwel@gmail.com>
This commit is contained in:
Harold Mciver
2025-07-16 16:12:22 -04:00
committed by GitHub
parent e4ed1aabac
commit 21eb44b242
7 changed files with 192 additions and 245 deletions

View File

@@ -17,8 +17,9 @@ import { themeCommand } from '../ui/commands/themeCommand.js';
import { statsCommand } from '../ui/commands/statsCommand.js';
import { privacyCommand } from '../ui/commands/privacyCommand.js';
import { aboutCommand } from '../ui/commands/aboutCommand.js';
import { compressCommand } from '../ui/commands/compressCommand.js';
import { extensionsCommand } from '../ui/commands/extensionsCommand.js';
import { toolsCommand } from '../ui/commands/toolsCommand.js';
import { compressCommand } from '../ui/commands/compressCommand.js';
import { mcpCommand } from '../ui/commands/mcpCommand.js';
// Mock the command modules to isolate the service from the command implementations.
@@ -49,18 +50,21 @@ vi.mock('../ui/commands/statsCommand.js', () => ({
vi.mock('../ui/commands/aboutCommand.js', () => ({
aboutCommand: { name: 'about', description: 'Mock About' },
}));
vi.mock('../ui/commands/compressCommand.js', () => ({
compressCommand: { name: 'compress', description: 'Mock Compress' },
}));
vi.mock('../ui/commands/extensionsCommand.js', () => ({
extensionsCommand: { name: 'extensions', description: 'Mock Extensions' },
}));
vi.mock('../ui/commands/toolsCommand.js', () => ({
toolsCommand: { name: 'tools', description: 'Mock Tools' },
}));
vi.mock('../ui/commands/compressCommand.js', () => ({
compressCommand: { name: 'compress', description: 'Mock Compress' },
}));
vi.mock('../ui/commands/mcpCommand.js', () => ({
mcpCommand: { name: 'mcp', description: 'Mock MCP' },
}));
describe('CommandService', () => {
const subCommandLen = 13;
const subCommandLen = 14;
describe('when using default production loader', () => {
let commandService: CommandService;
@@ -98,8 +102,9 @@ describe('CommandService', () => {
expect(commandNames).toContain('stats');
expect(commandNames).toContain('privacy');
expect(commandNames).toContain('about');
expect(commandNames).toContain('compress');
expect(commandNames).toContain('extensions');
expect(commandNames).toContain('tools');
expect(commandNames).toContain('compress');
expect(commandNames).toContain('mcp');
});
@@ -140,6 +145,7 @@ describe('CommandService', () => {
privacyCommand,
statsCommand,
themeCommand,
toolsCommand,
]);
});
});