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

describe("AuthDivider", (): void => {
  it("should render with default text", (): void => {
    render(<AuthDivider />);
    expect(screen.getByText("or continue with email")).toBeInTheDocument();
  });

  it("should render with custom text", (): void => {
    render(<AuthDivider text="or sign up" />);
    expect(screen.getByText("or sign up")).toBeInTheDocument();
  });

  it("should render a horizontal divider line", (): void => {
    const { container } = render(<AuthDivider />);
    const line = container.querySelector("span.border-t");
    expect(line).toBeInTheDocument();
  });

  it("should apply uppercase styling to text", (): void => {
    const { container } = render(<AuthDivider />);
    const textWrapper = container.querySelector(".uppercase");
    expect(textWrapper).toBeInTheDocument();
  });
});
