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
653 B
TypeScript
21 lines
653 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { extractUploadIdsFromUnknown } from "../../lib/server/uploads/extractUploadIds";
|
|
|
|
const ID = "550e8400-e29b-41d4-a716-446655440000";
|
|
|
|
describe("extractUploadIdsFromUnknown", () => {
|
|
it("collects unique upload ids from nested JSON", () => {
|
|
expect(
|
|
extractUploadIdsFromUnknown({
|
|
logo: `/api/uploads/${ID}`,
|
|
nested: { also: `/api/uploads/${ID}` },
|
|
other: "/api/uploads/not-a-uuid",
|
|
}),
|
|
).toEqual([ID]);
|
|
});
|
|
|
|
it("returns an empty list when nothing matches", () => {
|
|
expect(extractUploadIdsFromUnknown({ text: "no files" })).toEqual([]);
|
|
});
|
|
});
|