Skip to content
19 linesCodeBlameRaw
1import assert from "node:assert/strict";
2import { test } from "node:test";
3
4import { INVITES_DONE, doneMessage, invitesHref, joinedThrough } from "./invites.ts";
5
6test("the page has one address, with its search", () => {
7 assert.equal(invitesHref(), "/invites");
8 assert.equal(invitesHref({ q: "g1t-k7m2", empty: "" }), "/invites?q=g1t-k7m2");
9});
10
11test("revoking says so, and nothing else is flashed", () => {
12 assert.equal(doneMessage("revoked"), INVITES_DONE.revoked);
13 assert.equal(doneMessage("approved"), null);
14 assert.equal(doneMessage(null), null);
15});
16
17test("an account made with a shared link says where it came from", () => {
18 assert.equal(joinedThrough("Cloudflare judges"), "Joined through Cloudflare judges");
19});