import { describe, expect, it } from "vitest";
import { sessionSchema } from "./session";

describe("sessionSchema", () => {
  it("accepts a valid session", () => {
    const result = sessionSchema.parse({
      id: "session_1",
      userId: "1",
      expiresAt: new Date(),
    });
    expect(result.userId).toBe("1");
  });

  it("rejects non-Date expiresAt", () => {
    expect(() =>
      sessionSchema.parse({
        id: "session_1",
        userId: "1",
        expiresAt: "2026-05-04",
      }),
    ).toThrow();
  });
});
