tractatus/.claude
TheFlow c15ea3c20c feat(tests): create database test helper and diagnose integration test issues
PROBLEM: 10/26 integration test suites hanging (API tests)
- Tests import app but don't connect required databases
- Tractatus uses TWO separate DB connections (native + Mongoose)
- Tests only connected one, causing hangs when routes accessed User model

INVESTIGATION:
- Created minimal.test.js - diagnostic test (passes)
- Identified root cause: dual database architecture
- Updated api.auth.test.js with both connections (still investigating hang)

CREATED:
- tests/helpers/db-test-helper.js - Unified database setup helper
  Exports setupDatabases() and cleanupDatabases()
  Connects both native MongoDB driver AND Mongoose
  Ready for use in all integration tests

PARTIAL FIX:
- tests/integration/api.auth.test.js - Updated to connect both DBs
- Still investigating why tests hang (likely response field mismatch)

NEXT SESSION:
1. Apply db-test-helper to all 7 API integration tests
2. Fix response field mismatches (accessToken vs token)
3. Verify all tests pass

IMPACT: Test helper provides pattern for fixing all integration tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 15:39:27 +13:00
..
metrics feat(tests): create database test helper and diagnose integration test issues 2025-10-21 15:39:27 +13:00
session-archive chore(docs): archive historical session and analysis documents 2025-10-21 11:58:15 +13:00
sessions feat: fix CSP violations & implement three audience paths 2025-10-07 12:21:00 +13:00
framework-incidents.json feat(framework): implement 6 high-priority governance enhancements 2025-10-20 20:41:10 +13:00
instruction-history.json fix(mongodb): resolve production connection drops and add governance sync system 2025-10-21 11:39:05 +13:00
instruction-history.json.backup-20251012-143441 feat: newsletter modal and deployment script enhancements 2025-10-14 13:11:46 +13:00
plan-registry.json feat: comprehensive accessibility improvements (WCAG 2.1 AA) 2025-10-12 07:08:40 +13:00
tractatus-config.json feat: ACTIVATE Tractatus Governance Framework 🤖 2025-10-07 09:22:05 +13:00
user-suggestions.json chore(framework): session tracking, test enforcement, and schema improvements 2025-10-21 04:05:09 +13:00