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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/7670-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork

  • Merged. scout/7670-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as c41f946.

Review

Sign in to review this change.
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";
88 import { listEvents } from "../src/core/events.ts";
99 import { listPeople } from "../src/core/roles.ts";
1010 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";
1212 import { createForgeApp } from "../src/tui/forge.ts";
1313 import { headlessTerminal } from "../src/tui/term/terminal.ts";
1414 import { quietLogs } from "./helpers/globals.ts";
@@ -82,7 +82,7 @@ describe("verify an email from the People screen", () => {
8282 } finally {
8383 h.app.stop();
8484 }
85 });
85 }, 30_000);
8686
8787 test("`r` still changes a role on the list", async () => {
8888 const h = await open({ ...alice });
@@ -96,7 +96,7 @@ describe("verify an email from the People screen", () => {
9696 } finally {
9797 h.app.stop();
9898 }
99 });
99 }, 30_000);
100100
101101 test("someone who is not a forge admin is refused and nothing changes", async () => {
102102 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", () => {
112112 } finally {
113113 h.app.stop();
114114 }
115 });
115 }, 30_000);
116116
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);
118125 const byName = new Map(listPeople(forge.db).map((p) => [p.username, p.verified]));
119 expect(byName.get("bobby")).toBe(true);
120126 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);
122129 });
123130 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs