Skip to content

[P3] E2E: Seed data creates projects in wrong phase (active vs planning) #264

@frankbria

Description

@frankbria

Problem

E2E test seed data creates projects in active phase when tests expect planning phase. This causes 10+ test failures across Firefox, WebKit, Mobile Chrome, and Mobile Safari.

Failing Tests

Late-Joining User Tests:

  • test_late_joining_user.spec.ts:129 - should show "Tasks Ready" section @smoke
  • test_late_joining_user.spec.ts:201 - should not show "Generate Tasks" button

State Reconciliation Tests:

  • test_state_reconciliation.spec.ts:132 - should show "Review Tasks" @smoke
  • test_state_reconciliation.spec.ts:657 - should maintain correct state after page refresh @smoke

Error

Error: expect(received).toBe(expected) // Object.is equality
Expected: "planning"
Received: "active"

At line:

// Project must be in planning phase with tasks to test late-joining scenario
expect(progressData.phase).toBe('planning');

Root Cause

The seed script (scripts/seed-test-data.py) creates projects with tasks, but the phase transitions to active either:

  1. During seeding when tasks are added
  2. Due to automatic phase progression logic
  3. Because the seed explicitly sets active phase

Location

  • scripts/seed-test-data.py - Seed data creation
  • codeframe/persistence/repositories/ - Phase transition logic

Expected Behavior

For late-joining user tests, the seeded project should be:

  1. In planning phase
  2. Have tasks already generated
  3. Be awaiting user review/approval (not auto-progressed)

Suggested Fix

Option 1: Update seed script to explicitly set phase after task creation:

# After creating tasks
db.update_project_phase(project_id, "planning")

Option 2: Add a flag to prevent auto-phase-progression during seeding:

# Seed tasks without triggering phase change
db.create_tasks(tasks, auto_progress=False)

Impact

  • 10+ test failures across 4 browsers
  • Blocks late-joining user and state reconciliation test suites

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-post-betaLow priority - can wait until after beta (v2.0)bugSomething isn't workingtesting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions