| 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; |
| 3 | |
| 4 | import { INVITES_DONE, doneMessage, invitesHref, joinedThrough } from "./invites.ts"; |
| 5 | |
| 6 | test("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 | |
| 11 | test("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 | |
| 17 | test("an account made with a shared link says where it came from", () => { |
| 18 | assert.equal(joinedThrough("Cloudflare judges"), "Joined through Cloudflare judges"); |
| 19 | }); |