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.
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 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"], | |
| 12 | ["#invites", "/settings/invites"], | |
| 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); | |
| 29 | assert.equal(accountSettingsPage("/acme/web/settings/domains"), null); | |
| 30 | }); |