/**
 * Tests for SkeletonTableRow component.
 */

import { render } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { SkeletonTableRow } from "../SkeletonTableRow";

describe("SkeletonTableRow", () => {
  it("renders with default cell count", () => {
    const { container } = render(<SkeletonTableRow />);
    const cells = container.querySelectorAll('[role="presentation"] > div');
    expect(cells).toHaveLength(5);
  });

  it("renders with custom cell count", () => {
    const { container } = render(<SkeletonTableRow cellCount={8} />);
    const cells = container.querySelectorAll('[role="presentation"] > div');
    expect(cells).toHaveLength(8);
  });

  it("marks cells as aria-hidden", () => {
    const { container } = render(<SkeletonTableRow cellCount={3} />);
    const cells = container.querySelectorAll('[aria-hidden="true"]');
    expect(cells).toHaveLength(3);
  });

  it("has proper accessibility attributes", () => {
    const { container } = render(<SkeletonTableRow />);
    const row = container.querySelector('[role="presentation"]');
    expect(row).toBeInTheDocument();
  });
});
