import { describe, it, expect } from 'vitest'
import { render, screen } from '@testing-library/react'
import ChatBubble from '../../../src/renderer/src/components/ChatBubble'
describe('', () => {
it('should render a Max message with the max variant class', () => {
const { container } = render()
expect(screen.getByText('Bonjour !')).toBeInTheDocument()
expect(container.querySelector('.chat-bubble--max')).toBeInTheDocument()
})
it('should render a user message with the user variant class', () => {
const { container } = render()
expect(container.querySelector('.chat-bubble--user')).toBeInTheDocument()
})
it('should render simple markdown (bold, code)', () => {
const { container } = render()
expect(container.querySelector('strong')?.textContent).toBe('gras')
expect(container.querySelector('code')?.textContent).toBe('code')
})
it('should display the timestamp when provided', () => {
render()
expect(screen.getByText('10:30')).toBeInTheDocument()
})
it('should not render a time element when no timestamp is given', () => {
const { container } = render()
expect(container.querySelector('time')).not.toBeInTheDocument()
})
})