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

describe('<PieSkeleton>', () => {
  it('renders the default single-donut skeleton', () => {
    const { container } = render(<PieSkeleton />)
    expect(
      container.querySelectorAll('.MuiSkeleton-root').length,
    ).toBeGreaterThan(0)
  })

  it('accepts count but always renders a single donut', () => {
    const single = render(<PieSkeleton count={1} />)
    const many = render(<PieSkeleton count={3} />)
    const skeletonCount = (c: HTMLElement) =>
      c.querySelectorAll('.MuiSkeleton-root').length
    expect(skeletonCount(many.container)).toBe(skeletonCount(single.container))
  })
})
