// @vitest-environment jsdom import { fireEvent, render } from '@testing-library/react' import { describe, expect, it, vi } from 'vitest' import { AttachmentGallery } from './AttachmentGallery' describe('AttachmentGallery', () => { it('renders a compact quote preview for selected workspace text', () => { render( , ) expect(document.body.textContent).toContain('App.tsx:L10-L12') expect(document.body.textContent).toContain('const value = calculate(input) return value') }) it('keeps plain file chips on the one-line treatment', () => { render( , ) expect(document.body.textContent).toContain('README.md') expect(document.body.textContent).not.toContain(':L') }) it('removes a quoted workspace attachment by id', () => { const onRemove = vi.fn() const view = render( , ) fireEvent.click(view.getByRole('button', { name: 'Remove App.tsx' })) expect(onRemove).toHaveBeenCalledWith('selection-1') }) })