The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(conversations): add test files for mention and slash command sources
Steven Enamakelb2e628f0b7cd
diff --git a/app/src/features/conversations/aui/useMentionSource.test.tsx b/app/src/features/conversations/aui/useMentionSource.test.tsxindex 9bc3d0b682..507bf0f181 100644--- a/app/src/features/conversations/aui/useMentionSource.test.tsx+++ b/app/src/features/conversations/aui/useMentionSource.test.tsx@@ -11,6 +11,7 @@ import type { ReactNode } from 'react';import { Provider } from 'react-redux';import { beforeEach, describe, expect, it, vi } from 'vitest';+import { MOCK_MEMORY_RECALL } from '../../../pages/dev/assistant-ui-demo/assistantUiMock/mockScript';import { callCoreRpc } from '../../../services/coreRpcClient';import chatRuntimeReducer, { type ArtifactSnapshot } from '../../../store/chatRuntimeSlice';import type { Chunk } from '../../../utils/tauriCommands/memoryTree';@@ -103,6 +104,12 @@ describe('memoryMentionsFromChunks', () => {]);});+ it('maps the dev recall fixture to one memory mention per chunk', () => {+ const mentions = memoryMentionsFromChunks(MOCK_MEMORY_RECALL.chunks);+ expect(mentions.map(m => m.id)).toEqual(MOCK_MEMORY_RECALL.chunks.map(c => c.id));+ expect(mentions.every(m => m.label.length > 0)).toBe(true);+ });+it('falls back to the source id when a chunk has no preview', () => {const [mention] = memoryMentionsFromChunks([{ ...chunk('c2', ''), content_preview: undefined }]);expect(mention!.label).toBe('thread-9');diff --git a/app/src/features/conversations/aui/useSlashCommandSource.test.tsx b/app/src/features/conversations/aui/useSlashCommandSource.test.tsxindex 3de90e0476..4e29c59b86 100644--- a/app/src/features/conversations/aui/useSlashCommandSource.test.tsx+++ b/app/src/features/conversations/aui/useSlashCommandSource.test.tsx@@ -10,6 +10,7 @@ import type { ReactNode } from 'react';import { Provider } from 'react-redux';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { MOCK_COMMANDS_LIST } from '../../../pages/dev/assistant-ui-demo/assistantUiMock/mockScript';import { registry } from '../../../lib/commands/registry';import { callCoreRpc } from '../../../services/coreRpcClient';import runModeReducer from '../../../store/runModeSlice';@@ -89,6 +90,11 @@ describe('fetchCoreCommands', () => {]);});+ it('accepts the dev fixture as a well-formed commands_list response', async () => {+ rpcByMethod({ 'openhuman.commands_list': { data: { commands: MOCK_COMMANDS_LIST } } });+ await expect(fetchCoreCommands()).resolves.toEqual(MOCK_COMMANDS_LIST);+ });+it('accepts a bare array', async () => {rpcByMethod({ 'openhuman.commands_list': [SKILL] });await expect(fetchCoreCommands()).resolves.toEqual([SKILL]);