import { describe, expect, it } from "vitest";
import { hashPassword, verifyPassword } from "./routers";

describe("local password auth", () => {
  it("hashes passwords and verifies the original value", () => {
    const encoded = hashPassword("correct horse battery staple");
    expect(encoded).not.toContain("correct horse");
    expect(verifyPassword("correct horse battery staple", encoded)).toBe(true);
    expect(verifyPassword("wrong password", encoded)).toBe(false);
  });
});
