Files
community-rule/tests/unit/publishedRuleAccess.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

29 lines
860 B
TypeScript

import { describe, expect, it } from "vitest";
import {
LISTED_PUBLISHED_RULE_WHERE,
isListedPublishedRule,
} from "../../lib/publishedRuleAccess";
import { RULE_VISIBILITY } from "../../lib/ruleVisibility";
describe("isListedPublishedRule", () => {
it("lists public and featured Rules only", () => {
expect(
isListedPublishedRule({ visibility: RULE_VISIBILITY.public_and_featured }),
).toBe(true);
expect(
isListedPublishedRule({ visibility: RULE_VISIBILITY.private }),
).toBe(false);
expect(
isListedPublishedRule({ visibility: RULE_VISIBILITY.shared_by_link }),
).toBe(false);
});
});
describe("LISTED_PUBLISHED_RULE_WHERE", () => {
it("matches public and featured rows", () => {
expect(LISTED_PUBLISHED_RULE_WHERE).toEqual({
visibility: RULE_VISIBILITY.public_and_featured,
});
});
});