import { render, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { describe, expect, it } from 'vitest' import { Button, Checkbox, Input, RadioGroup, RadioGroupItem, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Switch, Textarea } from '../../src/renderer/src/components/ui' import { IconButton } from '../../src/renderer/src/components/ui/icon-button' import { SegmentedControl, SegmentedControlItem } from '../../src/renderer/src/components/ui/segmented-control' describe('TraceMemo UI control states', () => { it('uses the compact, standard, and form control height contract', () => { render( <> ) expect(screen.getByRole('button', { name: '紧凑' })).toHaveClass('h-control-compact') expect(screen.getByRole('button', { name: '标准' })).toHaveClass('h-control-standard') expect(screen.getByRole('button', { name: '表单' })).toHaveClass('h-control-form') expect(screen.getByRole('textbox', { name: '表单输入' })).toHaveClass('h-control-form') }) it('keeps secondary and icon actions visually quiet by default', () => { render( <> ) expect(screen.getByRole('button', { name: '次要操作' })).toHaveClass( 'border-border-subtle', 'bg-transparent' ) expect(screen.getByRole('button', { name: '刷新' })).toHaveClass( 'text-foreground', 'hover:bg-accent' ) expect(screen.getByRole('button', { name: '刷新' })).not.toHaveClass('bg-primary') }) it('uses a surface-free selected contract for segmented choices', () => { render( ) const selected = screen.getByRole('radio', { name: '一' }) expect(selected).toHaveClass( 'data-[state=checked]:bg-accent', 'data-[state=checked]:font-semibold' ) expect(selected).not.toHaveClass('data-[state=checked]:shadow-surface') }) it('keeps disabled controls readable without the old opacity and surface shadow', () => { render( <>