import { describe, expect, it } from 'vitest'
import {
  isBashTool,
  isChecklistPlanToolName,
  isInlinePlanMarkdownToolName,
  isWorkspaceNamespaceChildToolName,
  normalizeToolName,
  toolDisplayName,
} from './tool-rendering'

describe('tool-rendering helpers', () => {
  it('normalizes tool names and detects inline plan tools', () => {
    expect(normalizeToolName('read-file')).toBe('read-file')
    expect(isInlinePlanMarkdownToolName('todoplan')).toBe(true)
    expect(isChecklistPlanToolName('todoplan')).toBe(true)
    expect(isChecklistPlanToolName('plan_write')).toBe(false)
  })

  it('detects workspace child tools and exec-like tools', () => {
    expect(isWorkspaceNamespaceChildToolName('read-file')).toBe(true)
    expect(isWorkspaceNamespaceChildToolName('echo')).toBe(false)
    expect(isBashTool('shell')).toBe(true)
  })

  it('returns a non-empty display name', () => {
    expect(toolDisplayName('read-file').trim().length).toBeGreaterThan(0)
  })
})
