# proof: forum-voting (mutation check) date: 2026-11-07T23:29:53Z commit: 02f02cdfe02bc70310f7a2d71f757a53df070bed, with the planted change below in lib/forum/votes.ts (not committed) command: npm run test:forum-pg -- --verbose database: throwaway postgres:17-alpine (PG_VERSION=17.11), container runtime: podman version 5.7.0, bound to 127.0.0.1, removed on exit; no Neon, no shared database node: v26.13.0 expected: exit 1, failing the results test that counts pass votes planted change: diff --git a/lib/forum/votes.ts b/lib/forum/votes.ts index 70c0ae9..d52dfb6 100644 --- a/lib/forum/votes.ts +++ b/lib/forum/votes.ts @@ -59,7 +59,7 @@ export async function countVotes(): Promise { SELECT statement_id, locale, count(*) FILTER (WHERE vote = 'agree')::int AS agree, count(*) FILTER (WHERE vote = 'disagree')::int AS disagree, - count(*) FILTER (WHERE vote = 'pass')::int AS pass + count(*) FILTER (WHERE vote = 'passs')::int AS pass FROM votes GROUP BY statement_id, locale`) as Record[]; return rows.map((r) => ({ output: 127.0.0.1:5432 - accepting connections FAIL __tests__/forum-postgres.integration.test.ts forum on a real Postgres ✓ db/schema.sql applies, and applying it again changes nothing (57 ms) ✓ stores one vote per browser under a hash, and a second vote replaces the first (16 ms) ✓ the database itself refuses a vote other than agree, disagree or pass (2 ms) ✓ 'Clear my votes' deletes this browser's votes and no one else's (29 ms) ✕ votes flow through the results route into 'where groups agree' (395 ms) ✓ a suggestion can be voted on only once approved, and rejecting it removes its votes (35 ms) ✓ the database refuses a suggestion over 140 characters (2 ms) ● forum on a real Postgres › votes flow through the results route into 'where groups agree' expect(received).toEqual(expected) // deep equality - Expected - 1 + Received + 1 @@ -15,11 +15,11 @@ }, Object { "agree": 16, "disagree": 4, "locale": "de", - "pass": 3, + "pass": 0, "statementId": "t1-disclose", }, Object { "agree": 20, "disagree": 5, 226 | 227 | const sorted = [...rows].sort((a, b) => `${a.statementId}${a.locale}`.localeCompare(`${b.statementId}${b.locale}`)); > 228 | expect(sorted).toEqual([ | ^ 229 | { statementId: "t1-credentials", locale: "de", agree: 10, disagree: 10, pass: 0 }, 230 | { statementId: "t1-credentials", locale: "en", agree: 20, disagree: 5, pass: 0 }, 231 | { statementId: "t1-disclose", locale: "de", agree: 16, disagree: 4, pass: 3 }, at Object.toEqual (__tests__/forum-postgres.integration.test.ts:228:20) Test Suites: 1 failed, 1 total Tests: 1 failed, 6 passed, 7 total Snapshots: 0 total Time: 0.84 s, estimated 1 s Ran all test suites matching /__tests__\/forum-postgres.integration.test.ts/i. exit: 1