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

describe('<HistogramSkeleton>', () => {
  it('renders one Skeleton per bin (default 12) plus 4 legend stubs', () => {
    const { container } = render(<HistogramSkeleton />)
    // 12 bars + 2 legend items × (circle + label) = 16.
    expect(container.querySelectorAll('.MuiSkeleton-root').length).toBe(16)
  })

  it('honours a custom bin count', () => {
    const { container } = render(<HistogramSkeleton bins={4} />)
    expect(container.querySelectorAll('.MuiSkeleton-root').length).toBe(8)
  })
})
