Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(desktop): r7-m21 cover gfs preview version handoff

Josuéfebafd9ced56
diff --git a/desktop-app/ui/src/hooks/domain/__tests__/useNavigationController.test.ts b/desktop-app/ui/src/hooks/domain/__tests__/useNavigationController.test.ts
index e69c869d5..f17c4b544 100644
--- a/desktop-app/ui/src/hooks/domain/__tests__/useNavigationController.test.ts
+++ b/desktop-app/ui/src/hooks/domain/__tests__/useNavigationController.test.ts
@@ -2,6 +2,7 @@
import { describe, expect, it } from 'vitest'
import { act, renderHook } from '@testing-library/react'
import { AGENT_WORKSPACE_ROUTES, DESKTOP_ROUTES } from '../../../constants/navigation'
+import { resolveGfsPreview } from '../../../lib/gfsPreview'
import {
closeWorkspaceTab,
openChatTab,
@@ -87,6 +88,23 @@ describe('useNavigationController — agent-centric navigation (Fase 2)', () =>
expect(result.current.navItem).toBe(DESKTOP_ROUTES.preview)
})
+ it('carries the listing version into preview state for stale-row ordering', () => {
+ const { result } = renderHook(() => useNavigationController())
+ const preview = resolveGfsPreview({
+ gfsUri: 'gfs://main/versioned',
+ name: 'README.md',
+ bytes: 80,
+ version: 8,
+ })
+ expect(preview).not.toBeNull()
+ act(() => result.current.openPreviewSection(preview!))
+
+ expect(result.current.activeTab?.preview).toMatchObject({
+ gfsUri: 'gfs://main/versioned',
+ resourceVersion: 8,
+ })
+ })
+
it('openPreviewSection dedupes by gfsUri: re-opening the same file focuses its tab', () => {
const { result } = renderHook(() => useNavigationController())
act(() =>