fix: resolve Supabase database test failures#1330
Conversation
Fixed two test issues: - 40_test_email_preferences.sql: Create user in auth.users before inserting into public.users to satisfy foreign key constraint - 40_test_password_policy_enforcement.sql: Resolve ambiguous column reference and use proper existence check instead of invalid ON CONFLICT 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughTwo SQL test files updated to improve test reproducibility and prevent duplicate data. Test 13 in email preferences now uses deterministic user creation via a DO block. Password policy enforcement test replaces ON CONFLICT logic with conditional IF NOT EXISTS insertion to guard against duplicates. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 SQLFluff (3.5.0)supabase/tests/40_test_email_preferences.sqlUser Error: No dialect was specified. You must configure a dialect or specify one on the command line using --dialect after the command. Available dialects: supabase/tests/40_test_password_policy_enforcement.sqlUser Error: No dialect was specified. You must configure a dialect or specify one on the command line using --dialect after the command. Available dialects: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Fixed two test issues: - 40_test_email_preferences.sql: Create user in auth.users before inserting into public.users to satisfy foreign key constraint - 40_test_password_policy_enforcement.sql: Resolve ambiguous column reference and use proper existence check instead of invalid ON CONFLICT 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>



Summary
Fixed two failing Supabase database tests that were preventing the test suite from passing.
Test plan
Run
bun test:allornpx supabase test dbto verify all 790 tests pass.Changes
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.