tractatus/tests/integration
TheFlow b9be0fb3b6 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
..
api.admin.test.js fix: resolve all 29 production test failures 2025-10-09 20:58:37 +13:00
api.auth.test.js feat(tests): create database test helper and diagnose integration test issues 2025-10-21 15:39:27 +13:00
api.documents.test.js fix: improve About page presentation and resolve search endpoint tests 2025-10-10 11:39:14 +13:00
api.governance.test.js test: add comprehensive coverage for governance and markdown utilities 2025-10-09 21:32:13 +13:00
api.health.test.js fix: resolve all 29 production test failures 2025-10-09 20:58:37 +13:00
api.koha.test.js security: complete Koha authentication and security hardening 2025-10-09 21:10:29 +13:00
api.projects.test.js feat: implement Rule Manager and Project Manager admin systems 2025-10-11 17:16:51 +13:00
classifier-mongodb.test.js feat: enhance framework services and format architectural documentation 2025-10-11 00:50:47 +13:00
full-framework-integration.test.js feat: enhance framework services and format architectural documentation 2025-10-11 00:50:47 +13:00
hybrid-system-integration.test.js feat: enhance framework services and format architectural documentation 2025-10-11 00:50:47 +13:00
minimal.test.js feat(tests): create database test helper and diagnose integration test issues 2025-10-21 15:39:27 +13:00
sync-instructions.test.js fix(mongodb): resolve production connection drops and add governance sync system 2025-10-21 11:39:05 +13:00
validator-mongodb.test.js feat: enhance framework services and format architectural documentation 2025-10-11 00:50:47 +13:00
value-pluralism-integration.test.js test(integration): add value pluralism service integration tests 2025-10-12 16:35:38 +13:00