fix(test): update seed scripts to require valid plan handle IDs

- Replace placeholder plan IDs with explicit warnings
  - Change from test_project_X to PLACEHOLDER_ID_X
  - Add validation to prevent seeding with placeholders
  - Add helpful error messages with usage examples

- Add comprehensive guide for getting valid plan IDs
  - Methods: Create projects, query database, check account settings
  - Format examples: UUID, hash, custom formats
  - Step-by-step instructions for each method
  - Troubleshooting common issues

- Update test-user-zero.ts with placeholder warnings
  - Clear instructions on how to get real plan IDs
  - Links to documentation
  - Notes about plan ID format variations

- Improve test server startup
  - Warn when using placeholder IDs
  - Allow plan IDs via command line argument
  - Provide guidance on updating config

The previous test_project_X IDs were not valid for real TimeSafari
databases. Users must now provide actual plan handle IDs from their
TimeSafari setup, making testing more realistic and avoiding silent
failures with invalid IDs.
This commit is contained in:
Matthew Raymer
2025-10-29 12:18:10 +00:00
parent f5dca34e84
commit 7a19a56ea2
4 changed files with 263 additions and 12 deletions

View File

@@ -81,13 +81,26 @@ export const TEST_USER_ZERO_CONFIG = {
// Test Starred Projects (mock data for testing)
starredProjects: {
// Sample starred project IDs for testing
// IMPORTANT: Replace these with valid plan handle IDs from your TimeSafari database
//
// To get valid plan IDs:
// 1. Create projects in TimeSafari app and note their handleId from API responses
// 2. Query your local database: SELECT handleId FROM plans LIMIT 5
// 3. Check starred projects in account settings: settings.starredPlanHandleIds
// 4. See docs/getting-valid-plan-ids.md for detailed instructions
//
// Plan handle IDs can be:
// - UUIDs: "550e8400-e29b-41d4-a716-446655440000"
// - Hashes: "abc123def456789"
// - Or any format your TimeSafari backend uses
//
// For localhost testing with no projects, you can:
// - Use the test API server: node scripts/test-api-server-with-seed.js
// - Or create test projects first, then use their IDs here
planIds: [
"test_project_1",
"test_project_2",
"test_project_3",
"demo_project_alpha",
"demo_project_beta"
"PLACEHOLDER_ID_1", // Replace with real plan handle ID
"PLACEHOLDER_ID_2", // Replace with real plan handle ID
"PLACEHOLDER_ID_3" // Replace with real plan handle ID
],
// Last acknowledged JWT ID (for pagination testing)