/**
 * @ai-summary Tests for AdminSkeleton components
 */

import { render } from '@testing-library/react';
import { AdminSkeleton } from '../../components/AdminSkeleton';

describe('AdminSkeleton', () => {
  describe('SkeletonRow', () => {
    it('should render default number of rows', () => {
      const { container } = render(<AdminSkeleton.SkeletonRow />);

      expect(container).toMatchSnapshot();
    });

    it('should render specified number of rows', () => {
      const { container } = render(<AdminSkeleton.SkeletonRow count={5} />);

      expect(container).toMatchSnapshot();
      expect(container.querySelectorAll('.MuiSkeleton-root')).toHaveLength(15); // 3 skeletons per row * 5 rows
    });
  });

  describe('SkeletonCard', () => {
    it('should render default number of cards', () => {
      const { container } = render(<AdminSkeleton.SkeletonCard />);

      expect(container).toMatchSnapshot();
    });

    it('should render specified number of cards', () => {
      const { container } = render(<AdminSkeleton.SkeletonCard count={4} />);

      expect(container).toMatchSnapshot();
      expect(container.querySelectorAll('.MuiCard-root')).toHaveLength(4);
    });
  });
});
