import { describe, it, expect } from "vitest";
import { Hono } from "hono";
import { Card } from "../card.js";

describe("Card", () => {
  it("renders with card class", async () => {
    const app = new Hono().get("/", (c) => c.html(<Card>content</Card>));
    const res = await app.request("/");
    const html = await res.text();
    expect(html).toContain('class="card"');
    expect(html).toContain("content");
  });

  it("appends additional class names", async () => {
    const app = new Hono().get("/", (c) =>
      c.html(<Card class="extra">content</Card>)
    );
    const res = await app.request("/");
    const html = await res.text();
    expect(html).toContain('class="card extra"');
  });
});
