-
Notifications
You must be signed in to change notification settings - Fork 4
fix: Add test user to backend test setup to satisfy foreign key const… #501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…raint The session-persistence tests use 'user-123' as the userId for createDiscoverableSession, but the board_sessions.created_by_user_id column has a foreign key constraint referencing the users table. This fix: - Truncates the users table in beforeEach to ensure clean state - Creates the 'user-123' test user before each test
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Claude ReviewNo issues found. The fix correctly addresses the foreign key constraint issue by:
The |
The test setup was creating its own database connection, while roomManager uses the singleton db from @boardsesh/db/client. This caused the test user insertion to not be visible to roomManager when it tried to create discoverable sessions. Changes: - Import and use sharedDb (same instance as roomManager) for all data operations in beforeEach - Remove unused local db connection and related imports - Keep raw postgres client only for initial schema creation
Claude ReviewNo significant issues found. The fix correctly addresses the foreign key constraint violation by:
Minor note: The |
Changes: - Add kilter_climbs, kilter_climb_stats, kilter_difficulty_grades tables to test setup (required for climb query tests) - Add equivalent tension tables for tension board tests - Fix test parameters to use valid size_id values: - kilter: size_id 7 (12x14 Commercial) instead of 1 - tension: size_id 1 (Full Wall) is already valid The climb-queries tests require these tables to exist even if empty, as the queries need to execute against actual database tables.
Claude ReviewIssues Found
|
…raint
The session-persistence tests use 'user-123' as the userId for createDiscoverableSession, but the board_sessions.created_by_user_id column has a foreign key constraint referencing the users table.
This fix: