No description
Find a file
Jonathan Hvid 20209db2d8 test: vitest suite — pulse status, vote uniqueness, home route
Three test files covering the Phase 1 invariants:
- derivePulseStatus: draft/closed are sticky; open auto-closes by date.
- vote UNIQUE(pulse_id, user_id): castVote (OR IGNORE) keeps the first vote
  silently, a raw second INSERT raises a constraint error, and uniqueness is
  per-pulse (same user on a different pulse is fine).
- homeRouteForRole: cab/fenja → /pulse, pilot → null (render existing home).

tests/setup.ts opens BIFROST_DB_PATH=':memory:' and applies all migrations
before tests run, so the in-memory DB has the live schema. Each vitest fork
gets its own globalThis → its own fresh in-memory DB.

The homeRouteForRole helper extraction makes the / role-redirect testable
without booting Astro. Step 6 will use it from /index.astro.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 14:45:55 +02:00
.claude chore: add Innofounder logo to public, wire to home page 2026-04-19 20:36:54 +02:00
content feat: database schema, migrations, and seed data 2026-04-18 22:43:16 +02:00
design chore: add Innofounder logo to public, wire to home page 2026-04-19 20:36:54 +02:00
migrations feat(db): add migration 0003 for council portal schema 2026-05-11 14:39:07 +02:00
public chore: add Innofounder logo to public, wire to home page 2026-04-19 20:36:54 +02:00
scripts chore(seed): one-time roadmap seed from content/roadmap.md 2026-05-11 14:44:09 +02:00
src test: vitest suite — pulse status, vote uniqueness, home route 2026-05-11 14:45:55 +02:00
tests test: vitest suite — pulse status, vote uniqueness, home route 2026-05-11 14:45:55 +02:00
.env.example feat: database schema, migrations, and seed data 2026-04-18 22:43:16 +02:00
.gitignore wip: scaffold and index before style-guide 2026-04-18 16:09:49 +02:00
astro.config.mjs feat: database schema, migrations, and seed data 2026-04-18 22:43:16 +02:00
CLAUDE.md wip: scaffold and index before style-guide 2026-04-18 16:09:49 +02:00
DECISIONS.md docs: document decisions D-15 through D-18 2026-04-19 20:32:09 +02:00
HANDOVER.md docs: HANDOVER.md — build summary and next steps 2026-04-18 22:54:48 +02:00
KNOWN_ISSUES.md feat(db): add migration 0003 for council portal schema 2026-05-11 14:39:07 +02:00
package.json chore(seed): one-time roadmap seed from content/roadmap.md 2026-05-11 14:44:09 +02:00
pnpm-lock.yaml feat: database schema, migrations, and seed data 2026-04-18 22:43:16 +02:00
SPEC.md wip: scaffold and index before style-guide 2026-04-18 16:09:49 +02:00
tsconfig.json wip: scaffold and index before style-guide 2026-04-18 16:09:49 +02:00
vitest.config.ts test: vitest suite — pulse status, vote uniqueness, home route 2026-05-11 14:45:55 +02:00