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

describe('<BarSkeleton>', () => {
  it('renders without crashing', () => {
    const { container } = render(<BarSkeleton />)
    expect(container.firstChild).not.toBeNull()
  })

  it('renders MUI Skeleton placeholders for the bars + axis', () => {
    const { container } = render(<BarSkeleton />)
    // MuiSkeleton applies the .MuiSkeleton-root class — count > 1 confirms
    // both the bar grid AND the axis row are emitted.
    expect(
      container.querySelectorAll('.MuiSkeleton-root').length,
    ).toBeGreaterThan(1)
  })
})
