diff options
Diffstat (limited to 'packages/cli/src/services/CommandService.test.ts')
| -rw-r--r-- | packages/cli/src/services/CommandService.test.ts | 14 |
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 e780ec5f..bbee13fc 100644 --- a/packages/cli/src/services/CommandService.test.ts +++ b/packages/cli/src/services/CommandService.test.ts @@ -12,6 +12,7 @@ import { helpCommand } from '../ui/commands/helpCommand.js'; import { clearCommand } from '../ui/commands/clearCommand.js'; import { authCommand } from '../ui/commands/authCommand.js'; 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'; @@ -34,6 +35,9 @@ vi.mock('../ui/commands/themeCommand.js', () => ({ vi.mock('../ui/commands/privacyCommand.js', () => ({ privacyCommand: { name: 'privacy', description: 'Mock Privacy' }, })); +vi.mock('../ui/commands/statsCommand.js', () => ({ + statsCommand: { name: 'stats', description: 'Mock Stats' }, +})); vi.mock('../ui/commands/aboutCommand.js', () => ({ aboutCommand: { name: 'about', description: 'Mock About' }, })); @@ -62,7 +66,7 @@ describe('CommandService', () => { const tree = commandService.getCommands(); // Post-condition assertions - expect(tree.length).toBe(7); + expect(tree.length).toBe(8); const commandNames = tree.map((cmd) => cmd.name); expect(commandNames).toContain('auth'); @@ -70,6 +74,7 @@ describe('CommandService', () => { expect(commandNames).toContain('help'); expect(commandNames).toContain('clear'); expect(commandNames).toContain('theme'); + expect(commandNames).toContain('stats'); expect(commandNames).toContain('privacy'); expect(commandNames).toContain('about'); }); @@ -77,14 +82,14 @@ describe('CommandService', () => { it('should overwrite any existing commands when called again', async () => { // Load once await commandService.loadCommands(); - expect(commandService.getCommands().length).toBe(7); + expect(commandService.getCommands().length).toBe(8); // Load again await commandService.loadCommands(); const tree = commandService.getCommands(); // Should not append, but overwrite - expect(tree.length).toBe(7); + expect(tree.length).toBe(8); }); }); @@ -96,7 +101,7 @@ describe('CommandService', () => { await commandService.loadCommands(); const loadedTree = commandService.getCommands(); - expect(loadedTree.length).toBe(7); + expect(loadedTree.length).toBe(8); expect(loadedTree).toEqual([ aboutCommand, authCommand, @@ -104,6 +109,7 @@ describe('CommandService', () => { helpCommand, memoryCommand, privacyCommand, + statsCommand, themeCommand, ]); }); |
