summaryrefslogtreecommitdiff
path: root/packages/cli/src/services/CommandService.test.ts
diff options
context:
space:
mode:
authorHarold Mciver <[email protected]>2025-07-15 17:40:09 -0400
committerGitHub <[email protected]>2025-07-15 21:40:09 +0000
commitbf51de1a4d2111af4ece5a6d5567ed69f8f087df (patch)
tree4387256a373d4a74260314c4e6d0155d71b560f3 /packages/cli/src/services/CommandService.test.ts
parent58f1aa6ceb53df94cc5bba77dc787950be340cb9 (diff)
update `/extensions` to new slash command arch (#4229)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Diffstat (limited to 'packages/cli/src/services/CommandService.test.ts')
-rw-r--r--packages/cli/src/services/CommandService.test.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/packages/cli/src/services/CommandService.test.ts b/packages/cli/src/services/CommandService.test.ts
index bbee13fc..c309da34 100644
--- a/packages/cli/src/services/CommandService.test.ts
+++ b/packages/cli/src/services/CommandService.test.ts
@@ -15,6 +15,7 @@ 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 { extensionsCommand } from '../ui/commands/extensionsCommand.js';
// Mock the command modules to isolate the service from the command implementations.
vi.mock('../ui/commands/memoryCommand.js', () => ({
@@ -41,6 +42,9 @@ vi.mock('../ui/commands/statsCommand.js', () => ({
vi.mock('../ui/commands/aboutCommand.js', () => ({
aboutCommand: { name: 'about', description: 'Mock About' },
}));
+vi.mock('../ui/commands/extensionsCommand.js', () => ({
+ extensionsCommand: { name: 'extensions', description: 'Mock Extensions' },
+}));
describe('CommandService', () => {
describe('when using default production loader', () => {
@@ -66,7 +70,7 @@ describe('CommandService', () => {
const tree = commandService.getCommands();
// Post-condition assertions
- expect(tree.length).toBe(8);
+ expect(tree.length).toBe(9);
const commandNames = tree.map((cmd) => cmd.name);
expect(commandNames).toContain('auth');
@@ -77,19 +81,20 @@ describe('CommandService', () => {
expect(commandNames).toContain('stats');
expect(commandNames).toContain('privacy');
expect(commandNames).toContain('about');
+ expect(commandNames).toContain('extensions');
});
it('should overwrite any existing commands when called again', async () => {
// Load once
await commandService.loadCommands();
- expect(commandService.getCommands().length).toBe(8);
+ expect(commandService.getCommands().length).toBe(9);
// Load again
await commandService.loadCommands();
const tree = commandService.getCommands();
// Should not append, but overwrite
- expect(tree.length).toBe(8);
+ expect(tree.length).toBe(9);
});
});
@@ -101,11 +106,12 @@ describe('CommandService', () => {
await commandService.loadCommands();
const loadedTree = commandService.getCommands();
- expect(loadedTree.length).toBe(8);
+ expect(loadedTree.length).toBe(9);
expect(loadedTree).toEqual([
aboutCommand,
authCommand,
clearCommand,
+ extensionsCommand,
helpCommand,
memoryCommand,
privacyCommand,