The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(desktop): cover workspace pane reveal in selectSidebarItem
alelpoan5ecc6661468f
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsxindex 531937b64b8..31882d91b66 100644--- a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx@@ -3,6 +3,7 @@ import type { MutableRefObject } from 'react'import { useEffect } from 'react'import { afterEach, describe, expect, it, vi } from 'vitest'+import { noteActiveTreeGroup, revealTreePane } from '@/components/pane-shell/tree/store'import { getSession, getSessionMessages, type SessionInfo } from '@/hermes'import { createClientSessionState } from '@/lib/chat-runtime'import { clearSessionDraft, stashSessionDraft, takeSessionDraft } from '@/store/composer'@@ -55,6 +56,12 @@ vi.mock('@/store/profile', async importOriginal => ({ensureGatewayProfile: vi.fn().mockResolvedValue(undefined)}))+vi.mock('@/components/pane-shell/tree/store', async importOriginal => ({+ ...(await importOriginal<Record<string, unknown>>()),+ noteActiveTreeGroup: vi.fn(),+ revealTreePane: vi.fn()+}))+const RUNTIME_SESSION_ID = 'rt-new-001'function deferred<T>() {@@ -69,7 +76,7 @@ function deferred<T>() {type HarnessHandle = Pick<ReturnType<typeof useSessionActions>,- 'createBackendSessionForSend' | 'startFreshSessionDraft'+ 'createBackendSessionForSend' | 'selectSidebarItem' | 'startFreshSessionDraft'>function storedSession(overrides: Partial<SessionInfo> = {}): SessionInfo {@@ -1590,3 +1597,21 @@ describe('createBackendSessionForSend workspace target', () => {expect(params).toMatchObject({ cwd: '/clicked-workspace' })})})+describe('selectSidebarItem', () => {+ it('fronts the workspace pane when navigating to a sidebar route (issue #72602)', async () => {+ const navigate = vi.fn()+ const requestGateway = vi.fn(async () => ({}) as never)+ let handle: HarnessHandle | null = null++ render(<Harness navigate={navigate} onReady={value => (handle = value)} requestGateway={requestGateway} />)+ await waitFor(() => expect(handle).not.toBeNull())++ act(() => {+ handle!.selectSidebarItem({ icon: (() => null) as never, id: 'skills', label: 'Capabilities', route: '/skills' })+ })++ expect(navigate).toHaveBeenCalledWith('/skills', undefined)+ expect(noteActiveTreeGroup).toHaveBeenCalledWith(null)+ expect(revealTreePane).toHaveBeenCalledWith('workspace')+ })+})