import { describe, expect, it } from "vitest" import { getPasswordHash, verifyPassword } from "@/lib/security" describe("security helpers", () => { it("hashes passwords and verifies the original plain password", async () => { const hash = await getPasswordHash("secure-password") expect(hash).not.toBe("secure-password") await expect(verifyPassword("secure-password", hash)).resolves.toBe(true) await expect(verifyPassword("wrong-password", hash)).resolves.toBe(false) }) it("rejects empty passwords when hashing", async () => { await expect(getPasswordHash("")).rejects.toThrow("Password is required") }) })