Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

601 B
Raw Blame
import { describe, expect, it } from "vite-plus/test";
import { tokenFingerprint } from "./token-fingerprint";

describe("tokenFingerprint", () => {
  it("is stable for the same token", () => {
    expect(tokenFingerprint("glpat-abc123")).toBe(
      tokenFingerprint("glpat-abc123"),
    );
  });

  it("changes when the token changes", () => {
    expect(tokenFingerprint("glpat-abc123")).not.toBe(
      tokenFingerprint("glpat-abc124"),
    );
  });

  it("returns a short hex digest rather than the token", () => {
    expect(tokenFingerprint("glpat-abc123")).toMatch(/^[0-9a-f]{8}$/);
  });
});