You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
603 B
19 lines
603 B
import { describe, expect, test } from "bun:test";
|
|
import { newShareToken, visibilityShareToken } from "./share-token";
|
|
|
|
describe("visibilityShareToken", () => {
|
|
test("unlisted keeps existing token", () => {
|
|
const t = newShareToken();
|
|
expect(visibilityShareToken("unlisted", t)).toBe(t);
|
|
});
|
|
|
|
test("unlisted generates token when missing", () => {
|
|
const t = visibilityShareToken("unlisted", null);
|
|
expect(t).toBeTruthy();
|
|
expect(t!.length).toBeGreaterThan(20);
|
|
});
|
|
|
|
test("public clears token", () => {
|
|
expect(visibilityShareToken("public", "abc")).toBeNull();
|
|
});
|
|
});
|
|
|