Files
community-rule/tests/unit/shareSlug.test.ts
T
adilallo 5cbda35e32 Start every Rule private, with a rotating link and files that follow its readers.
New Rules stay off lists until the person who holds the pen turns on a share link, or the team features one. Uploaded files are readable only by those readers, stripped of location metadata, and deleted with the Rule, draft, or account.
2026-11-09 19:54:04 -07:00

21 lines
486 B
TypeScript

import { describe, expect, it, vi } from "vitest";
vi.mock("../../lib/server/db", () => ({
prisma: {
publishedRule: {
findUnique: vi.fn(),
},
},
}));
import { isShareSlug } from "../../lib/sharePaths";
import { generateShareSlug } from "../../lib/server/shareSlug";
describe("generateShareSlug", () => {
it("returns the rotating slug shape", () => {
for (let i = 0; i < 12; i += 1) {
expect(isShareSlug(generateShareSlug())).toBe(true);
}
});
});