Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:329rnexjmg is past its budget: trevato/forge: "verify an email from the People screen > listPeople says who is verified" failed on 3 pulls in the last… #7705
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/7670-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork
1 file
changed +14
−7
test/tui-people-verify.test.ts +14 −7
| @@ -8,7 +8,7 @@ import { createApp, type App as Forge } from "../src/app.ts"; | ||
| 8 | 8 | import { listEvents } from "../src/core/events.ts"; |
| 9 | 9 | import { listPeople } from "../src/core/roles.ts"; |
| 10 | 10 | import { createUser, type User } from "../src/core/users.ts"; |
| 11 | import { emailVerified, markUnproven } from "../src/core/verify.ts"; | |
| 11 | import { emailVerified, markUnproven, markVerified } from "../src/core/verify.ts"; | |
| 12 | 12 | import { createForgeApp } from "../src/tui/forge.ts"; |
| 13 | 13 | import { headlessTerminal } from "../src/tui/term/terminal.ts"; |
| 14 | 14 | import { quietLogs } from "./helpers/globals.ts"; |
| @@ -82,7 +82,7 @@ describe("verify an email from the People screen", () => { | ||
| 82 | 82 | } finally { |
| 83 | 83 | h.app.stop(); |
| 84 | 84 | } |
| 85 | }); | |
| 85 | }, 30_000); | |
| 86 | 86 | |
| 87 | 87 | test("`r` still changes a role on the list", async () => { |
| 88 | 88 | const h = await open({ ...alice }); |
| @@ -96,7 +96,7 @@ describe("verify an email from the People screen", () => { | ||
| 96 | 96 | } finally { |
| 97 | 97 | h.app.stop(); |
| 98 | 98 | } |
| 99 | }); | |
| 99 | }, 30_000); | |
| 100 | 100 | |
| 101 | 101 | test("someone who is not a forge admin is refused and nothing changes", async () => { |
| 102 | 102 | const carol = await createUser(forge.db, { username: "carol", email: "[email protected]", password: "a-long-passphrase", origin: "seed" }); |
| @@ -112,12 +112,19 @@ describe("verify an email from the People screen", () => { | ||
| 112 | 112 | } finally { |
| 113 | 113 | h.app.stop(); |
| 114 | 114 | } |
| 115 | }); | |
| 115 | }, 30_000); | |
| 116 | 116 | |
| 117 | test("listPeople says who is verified", () => { | |
| 117 | // Its own accounts, so its verdict never rests on the screen tests above. | |
| 118 | test("listPeople says who is verified", async () => { | |
| 119 | const proven = await createUser(forge.db, { username: "dora", email: "[email protected]", password: "a-long-passphrase", origin: "seed" }); | |
| 120 | const unproven = await createUser(forge.db, { username: "evan", email: "[email protected]", password: "a-long-passphrase", origin: "seed" }); | |
| 121 | if (!proven.ok || !unproven.ok) throw new Error("signup failed"); | |
| 122 | markUnproven(forge.db, proven.value.id); | |
| 123 | markVerified(forge.db, proven.value.id, new Date().toISOString()); | |
| 124 | markUnproven(forge.db, unproven.value.id); | |
| 118 | 125 | const byName = new Map(listPeople(forge.db).map((p) => [p.username, p.verified])); |
| 119 | expect(byName.get("bobby")).toBe(true); | |
| 120 | 126 | expect(byName.get("alice")).toBe(true); |
| 121 | expect(byName.get("carol")).toBe(false); | |
| 127 | expect(byName.get("dora")).toBe(true); | |
| 128 | expect(byName.get("evan")).toBe(false); | |
| 122 | 129 | }); |
| 123 | 130 | }); |
new above
offline