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.
21 lines
486 B
TypeScript
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);
|
|
}
|
|
});
|
|
});
|