import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { RelinkPanel } from "./RelinkPanel";
describe("RelinkPanel", () => {
it("shows the remaining allowance", () => {
render();
expect(screen.getByText("2 of 3 relinks left this term")).toBeInTheDocument();
expect(screen.getByRole("button", { name: /relink/i })).toBeEnabled();
});
it("disables at zero and says what to do instead", () => {
render();
expect(screen.getByRole("button", { name: /relink/i })).toBeDisabled();
expect(screen.getByText(/contact support/i)).toBeInTheDocument();
});
});