import { describe, it, expect } from 'vitest'
import { render, screen } from '@testing-library/react'
import { Preview } from './Preview'

describe('Preview', () => {
  it('renders markdown content as HTML', () => {
    render(<Preview content="# Hello" />)
    const heading = screen.getByRole('heading', { name: 'Hello' })
    expect(heading).toBeInTheDocument()
  })

  it('renders empty state message when no content', () => {
    render(<Preview content="" />)
    expect(screen.getByText(/start typing to see preview/i)).toBeInTheDocument()
  })

  it('renders bold text', () => {
    render(<Preview content="**bold text**" />)
    expect(screen.getByText('bold text')).toBeInTheDocument()
  })

  it('renders list items', () => {
    render(<Preview content="- item 1" />)
    expect(screen.getByText('item 1')).toBeInTheDocument()
  })
})
