Shell and Agent 1 UI components per docs/Max_Composants_Frontend.md: - InputBar: send on Enter, newline on Shift+Enter, mic toggle (STT itself stays in the main process). - ChatBubble: max/user variants reusing the existing chat-bubble design-system classes, simple Markdown via react-markdown+remark-gfm. - AvatarStatusIndicator: purely visual, no status computed here. - PipelineStepper + utils/pipelineSteps.ts: the stepper itself only renders the `steps` prop as given (never computes status); the session.status -> step list derivation lives in a separate pure function the store/App call, per the doc's explicit rule that the component must never calculate status itself. - ObjectiveValidationCard: single-field-at-a-time editing, locked and irreversible once onConfirm resolves. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
32 lines
1.3 KiB
TypeScript
32 lines
1.3 KiB
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { render, screen } from '@testing-library/react'
|
|
import AvatarStatusIndicator from '../../../src/renderer/src/components/AvatarStatusIndicator'
|
|
|
|
describe('<AvatarStatusIndicator />', () => {
|
|
it('should render nothing when idle', () => {
|
|
const { container } = render(<AvatarStatusIndicator status="idle" />)
|
|
expect(container).toBeEmptyDOMElement()
|
|
})
|
|
|
|
it('should show the default label for thinking', () => {
|
|
render(<AvatarStatusIndicator status="thinking" />)
|
|
expect(screen.getByText('Max reflechit...')).toBeInTheDocument()
|
|
})
|
|
|
|
it('should show the default label for speaking', () => {
|
|
render(<AvatarStatusIndicator status="speaking" />)
|
|
expect(screen.getByText('Max parle...')).toBeInTheDocument()
|
|
})
|
|
|
|
it('should show a fixed green dot and "En attente" for waiting', () => {
|
|
const { container } = render(<AvatarStatusIndicator status="waiting" />)
|
|
expect(screen.getByText('En attente')).toBeInTheDocument()
|
|
expect(container.querySelector('.avatar-status__dot--waiting')).toBeInTheDocument()
|
|
})
|
|
|
|
it('should prefer an explicit label over the default one', () => {
|
|
render(<AvatarStatusIndicator status="thinking" label="Max recherche des sources..." />)
|
|
expect(screen.getByText('Max recherche des sources...')).toBeInTheDocument()
|
|
})
|
|
})
|