hermes-agent/ui-tui/src/__tests__/journeyCommand.test.ts
Brooklyn Nicholson e971dc1e9d feat(journey): CLI + TUI learning timeline (/journey)
Terminal rendition of the desktop Star Map / Memory Graph: learned skills
and memories on a timeline, shared by `hermes journey` and the TUI
`/journey` overlay via one size-aware Python renderer
(agent/learning_graph_render.py).

- TUI overlay mirrors /agents: static chart overview + selectable slice
  list → slice detail → single skill/memory body, with the shared
  inverse-row selection treatment and a pinned footer.
- Reuse primitives: extract OverlayScrollbar into its own module (now
  shared with agentsOverlay), scroll the item body via ScrollBox, and
  unify both lists through one table-driven ListRow.
- No animation/playback in the TUI — pure data; the renderer's reveal
  scrubber stays available in the CLI (`--play`, `--reveal`).
2026-06-30 04:44:58 -05:00

32 lines
1.1 KiB
TypeScript

import { beforeEach, describe, expect, it } from 'vitest'
import { getOverlayState, resetOverlayState } from '../app/overlayStore.js'
import { findSlashCommand } from '../app/slash/registry.js'
describe('/journey slash command', () => {
beforeEach(() => {
resetOverlayState()
})
it('resolves by name and aliases', () => {
expect(findSlashCommand('journey')?.name).toBe('journey')
for (const alias of ['learning', 'memory-graph']) {
expect(findSlashCommand(alias)?.name).toBe('journey')
}
})
it('opens the journey overlay when run', () => {
expect(getOverlayState().journey).toBe(false)
findSlashCommand('journey')!.run('', {} as never, 'journey')
expect(getOverlayState().journey).toBe(true)
})
it('is preserved by the flow-overlay soft reset (deliberate, user-opened)', async () => {
findSlashCommand('journey')!.run('', {} as never, 'journey')
// Mirror turnController.idle(): flow overlays clear, user-opened panels stay.
const { resetFlowOverlays } = await import('../app/overlayStore.js')
resetFlowOverlays()
expect(getOverlayState().journey).toBe(true)
})
})