import { render, screen } from '@testing-library/react'
import { BadgeList } from '../components/profile/badge-list'

describe('BadgeList', () => {
    it('renders "No badges" message when list is empty', () => {
        render(<BadgeList badges={[]} />)
        expect(screen.getByText(/No badges earned yet/i)).toBeInTheDocument()
    })

    it('renders badges when provided', () => {
        const badges = [
            { id: 1, name: 'Test Badge', description: 'A test badge', icon: 'star', slug: 'test' }
        ]
        render(<BadgeList badges={badges} />)
        expect(screen.getByText('Test Badge')).toBeInTheDocument()
        expect(screen.getByText('A test badge')).toBeInTheDocument()
    })
})
