feat: Implement tournament schedule tab and fix E2E tests #27

Merged
david merged 43 commits from feature/7-schedule-tab into main 2026-04-27 01:59:17 +00:00
Showing only changes of commit c18cf29452 - Show all commits
+25
View File
@@ -23,6 +23,31 @@ if (fs.existsSync(envDevPath)) {
require('dotenv').config({ path: envDevPath, override: true }); require('dotenv').config({ path: envDevPath, override: true });
} }
// Database safety check - prevent tests from running against production
function isProductionDatabase(): boolean {
const dbUrl = process.env.DATABASE_URL || '';
return dbUrl.includes('euchre_camp') && !dbUrl.includes('_dev') && !dbUrl.includes('test');
}
if (isProductionDatabase()) {
console.error('');
console.error('='.repeat(80));
console.error('CRITICAL ERROR: Cucumber tests are attempting to run against PRODUCTION database!');
console.error('='.repeat(80));
console.error('');
console.error('Current DATABASE_URL:', process.env.DATABASE_URL);
console.error('');
console.error('Tests MUST run against a development/test database.');
console.error('');
console.error('To fix this:');
console.error(' 1. Set DATABASE_URL to a dev/test database');
console.error(' 2. Or run: npm run test:acceptance (which uses Playwright tests)');
console.error('');
console.error('Aborting test execution to prevent data corruption.');
console.error('');
process.exit(1);
}
/** /**
* Before all scenarios: Launch browser * Before all scenarios: Launch browser
*/ */