import { describe, it, expect } from 'vitest'; import { render, screen } from '@testing-library/react'; import { TestApp } from '@/test/TestApp'; import { ToolCallDisplay } from './ToolCallDisplay'; describe('ToolCallDisplay', () => { describe('path stripping', () => { it('should strip project prefix from absolute paths for read tool', () => { render( ); expect(screen.getByText('Viewed src/index.ts')).toBeInTheDocument(); }); it('should strip project prefix from absolute paths for write tool', () => { render( ); expect(screen.getByText('Wrote src/App.tsx')).toBeInTheDocument(); }); it('should strip project prefix from absolute paths for edit tool', () => { render( ); expect(screen.getByText('Edited src/components/Header.tsx')).toBeInTheDocument(); }); it('should handle paths without project prefix', () => { render( ); expect(screen.getByText('Viewed src/index.ts')).toBeInTheDocument(); }); it('should handle legacy text_editor_view tool', () => { render( ); expect(screen.getByText('Viewed README.md')).toBeInTheDocument(); }); it('should handle legacy text_editor_write tool', () => { render( ); expect(screen.getByText('Wrote package.json')).toBeInTheDocument(); }); it('should handle legacy text_editor_str_replace tool', () => { render( ); expect(screen.getByText('Edited src/utils.ts')).toBeInTheDocument(); }); it('should handle different projects with same relative path', () => { render( ); expect(screen.getByText('Viewed src/index.ts')).toBeInTheDocument(); }); }); });