Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running | 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; | |
| 3 | ||
| 4 | import { ACCOUNT_SETTINGS, accountSettingsPage, settingsPathForHash } from "./account-settings.ts"; | |
| 5 | ||
| 6 | test("every anchor of the old settings page lands on its own page", () => { | |
| 7 | const cases: [string, string][] = [ | |
| 8 | ["#picture", "/settings/profile"], | |
| 9 | ["#profile", "/settings/profile"], | |
| 10 | ["#emails", "/settings/emails"], | |
| 11 | ["#github", "/settings/github"], | |
| Anyone on g1t can invite a friend again: Invite a friend, in the account menu with how many are left beside it, opens Settings → Invites to g1t with a dialog for their email address and a note. The friend gets an email from them whose link opens sign-up with the address filled in and, because it came from that email, confirmed; their account starts with a workspace of its own, and the page lists every invite sent with where it stands (Pending, confirming their email, Joined as @them), with Copy link, Send again and Revoke on each. It is word of mouth, never a gate: sign-ups stay open to everyone, nothing asks for an invite, and running out says friends can still sign up without one. | 12 | ["#invites", "/settings/invites"], |
| Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running | 13 | ["#ssh-keys", "/settings/keys"], |
| 14 | ["#tokens", "/settings/tokens"], | |
| 15 | ["#applications", "/settings/applications"], | |
| 16 | ["#security-log", "/settings/security-log"], | |
| 17 | ]; | |
| 18 | for (const [hash, path] of cases) assert.equal(settingsPathForHash(hash), path, hash); | |
| 19 | assert.equal(settingsPathForHash(""), null); | |
| 20 | assert.equal(settingsPathForHash("#nothing"), null); | |
| 21 | }); | |
| 22 | ||
| 23 | test("a settings path names its page", () => { | |
| 24 | for (const page of Object.keys(ACCOUNT_SETTINGS)) { | |
| 25 | assert.equal(accountSettingsPage(`/settings/${page}`), page); | |
| 26 | } | |
| 27 | assert.equal(accountSettingsPage("/settings"), null); | |
| 28 | assert.equal(accountSettingsPage("/settings/nope"), null); | |
| One kind of access token; presence and status; usernames keep their case; the tour is a miniature of the real app; icons for password managers | 29 | assert.equal(accountSettingsPage("/settings/tokens/tok_1"), "tokens", "a token's page is under Access tokens"); |
| Costs: a statement that keeps usage sold, running g1t, subscriptions and what was given away (comped, free use, trial, pool) apart, and says who was paid; free use carries its own cost; the run button says it is running | 30 | assert.equal(accountSettingsPage("/acme/web/settings/domains"), null); |
| 31 | }); |
This file's history is long; its oldest lines are credited to the oldest commit read.