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

vi.mock("@/components/DashboardLayout", () => ({
  default: ({ title, subtitle, children }: { title: string; subtitle: string; children: React.ReactNode }) => (
    <main><h1>{title}</h1><p>{subtitle}</p>{children}</main>
  ),
}));
vi.mock("@/components/profile/ChangePasswordForm", () => ({
  default: () => <form>نموذج تغيير كلمة المرور</form>,
}));
import ChangePasswordPage from "@/app/change-password/page";

describe("ChangePasswordPage", () => {
  it("renders its dashboard title and password form", () => {
    render(<ChangePasswordPage />);
    expect(screen.getAllByRole("heading", { name: "تغيير كلمة المرور" })).toHaveLength(2);
    expect(screen.getByText("حافظ على أمان حسابك بكلمة مرور قوية")).toBeInTheDocument();
    expect(screen.getByText("نموذج تغيير كلمة المرور")).toBeInTheDocument();
  });
});
