diff options
| author | haroldmciver-go <[email protected]> | 2025-07-11 16:01:28 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-11 20:01:28 +0000 |
| commit | 4197f3027857f1f6e83aedacb7e47a07690e2095 (patch) | |
| tree | d2d568850fb8dce11e383f8252fe59330791ff7d /packages/cli/src/services/CommandService.test.ts | |
| parent | 2826c7a1c60bc09d256d7a7c11bdd98f65316cb7 (diff) | |
update /theme to new slash command arch (#3791)
Co-authored-by: matt korwel <[email protected]>
Co-authored-by: Abhi <[email protected]>
Diffstat (limited to 'packages/cli/src/services/CommandService.test.ts')
| -rw-r--r-- | packages/cli/src/services/CommandService.test.ts | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/packages/cli/src/services/CommandService.test.ts b/packages/cli/src/services/CommandService.test.ts index f5a5a835..e479a2ac 100644 --- a/packages/cli/src/services/CommandService.test.ts +++ b/packages/cli/src/services/CommandService.test.ts @@ -10,6 +10,7 @@ import { type SlashCommand } from '../ui/commands/types.js'; import { memoryCommand } from '../ui/commands/memoryCommand.js'; import { helpCommand } from '../ui/commands/helpCommand.js'; import { clearCommand } from '../ui/commands/clearCommand.js'; +import { themeCommand } from '../ui/commands/themeCommand.js'; // Mock the command modules to isolate the service from the command implementations. vi.mock('../ui/commands/memoryCommand.js', () => ({ @@ -21,6 +22,9 @@ vi.mock('../ui/commands/helpCommand.js', () => ({ vi.mock('../ui/commands/clearCommand.js', () => ({ clearCommand: { name: 'clear', description: 'Mock Clear' }, })); +vi.mock('../ui/commands/themeCommand.js', () => ({ + themeCommand: { name: 'theme', description: 'Mock Theme' }, +})); describe('CommandService', () => { describe('when using default production loader', () => { @@ -46,25 +50,26 @@ describe('CommandService', () => { const tree = commandService.getCommands(); // Post-condition assertions - expect(tree.length).toBe(3); + expect(tree.length).toBe(4); const commandNames = tree.map((cmd) => cmd.name); expect(commandNames).toContain('memory'); expect(commandNames).toContain('help'); expect(commandNames).toContain('clear'); + expect(commandNames).toContain('theme'); }); it('should overwrite any existing commands when called again', async () => { // Load once await commandService.loadCommands(); - expect(commandService.getCommands().length).toBe(3); + expect(commandService.getCommands().length).toBe(4); // Load again await commandService.loadCommands(); const tree = commandService.getCommands(); // Should not append, but overwrite - expect(tree.length).toBe(3); + expect(tree.length).toBe(4); }); }); @@ -76,8 +81,13 @@ describe('CommandService', () => { await commandService.loadCommands(); const loadedTree = commandService.getCommands(); - expect(loadedTree.length).toBe(3); - expect(loadedTree).toEqual([clearCommand, helpCommand, memoryCommand]); + expect(loadedTree.length).toBe(4); + expect(loadedTree).toEqual([ + clearCommand, + helpCommand, + memoryCommand, + themeCommand, + ]); }); }); }); |
