CAIRL Roadmap Phase 2 - Testing Script

Feature Branch: feature/roadmap-admin-interface Phase: 2 Complete (2A + 2B + 2C) Tester: HuggyCoder Date: **___**


Part 1: Automated Checks (Claude Code)

Run these commands. All must pass before UAT begins.

# ── Build & Type Safety ──────────────────────────────
echo "=== 1. Type Check ==="
npm run type-check
echo ""

echo "=== 2. Lint ==="
npm run lint
echo ""

echo "=== 3. Build ==="
npm run build
echo ""

# ── Database ─────────────────────────────────────────
echo "=== 4. Generate Migration ==="
npm run db:generate
echo ""

echo "=== 5. Apply Migrations ==="
npm run db:migrate
echo ""

echo "=== 6. Run Seed Script ==="
npx tsx scripts/seed-roadmap.ts
echo ""

# ── API Smoke Tests ──────────────────────────────────
# Start dev server first: npm run dev

echo "=== 7. API: List Initiatives ==="
curl -s http://localhost:3000/api/roadmap/initiatives | head -c 500
echo ""

echo "=== 8. API: List Sprints ==="
curl -s http://localhost:3000/api/roadmap/sprints | head -c 500
echo ""

echo "=== 9. API: List Tasks ==="
curl -s http://localhost:3000/api/roadmap/tasks | head -c 500
echo ""

echo "=== 10. API: List Dependencies ==="
curl -s http://localhost:3000/api/roadmap/dependencies | head -c 500
echo ""

echo "=== 11. API: List Changelog ==="
curl -s http://localhost:3000/api/roadmap/changelog | head -c 500
echo ""

echo "=== 12. API: Create Initiative ==="
curl -s -X POST http://localhost:3000/api/roadmap/initiatives \
  -H "Content-Type: application/json" \
  -d '{
    "title": "TEST: Smoke Test Initiative",
    "category": "tech_debt",
    "phase": "exploration",
    "priority": "low"
  }' | head -c 500
echo ""

echo "=== 13. API: Create Sprint ==="
curl -s -X POST http://localhost:3000/api/roadmap/sprints \
  -H "Content-Type: application/json" \
  -d '{
    "title": "TEST: Smoke Test Sprint",
    "category": "tech_debt",
    "phase": "exploration",
    "priority": "low"
  }' | head -c 500
echo ""

# Note: These curl tests may return 401/403 if auth is required.
# If so, that's correct behavior — confirms auth guard works.
# Test authenticated routes through the browser UI instead.

echo ""
echo "=== AUTOMATED CHECKS COMPLETE ==="
echo "If type-check, lint, and build passed: proceed to UAT"
echo "If API returns 401/403: auth guards working, test via browser"

Part 2: UAT Checklist

Prerequisites

1. Dev Server

  • Dev server running (npm run dev)
  • Browser dev tools open (Console tab for errors)

2. Database Setup

  • Migrations applied (npm run db:migrate)
  • Seed data loaded (npx tsx scripts/seed-roadmap.ts)
  • Verify seed data: initiatives, sprints, tasks visible in database

3. Admin User Setup

REQUIRED: The seed script does NOT create admin users. You must have an admin user before starting UAT.

Option A: Use Existing Admin User

  • Admin user already exists in database
  • Skip to authentication step

Option B: Create Admin User via Registration

  1. Navigate to registration page
  2. Create user with email: admin@test.cairl.local
  3. Manually update role in database:
# Connect to local database
psql "postgresql://localhost:5433/cairl_local"

# Update user role to admin
UPDATE users SET role = 'admin' WHERE email = 'admin@test.cairl.local';

# Verify
SELECT id, email, role FROM users WHERE role = 'admin';

# Exit
\q

Option C: Direct Database Insert

# Connect to local database
psql "postgresql://localhost:5433/cairl_local"

# Check users table schema
\d users

# Insert admin user (adjust fields based on your schema)
INSERT INTO users (email, role, email_verified)
VALUES ('admin@test.cairl.local', 'admin', true);

# Exit
\q

4. Authentication

  • Logged in as admin user (super_admin or admin role)
  • Verify admin access to /admin routes

2.1 Dashboard Overview (/admin/roadmap)

# Test Expected Pass?
1 Navigate to /admin/roadmap Page loads without console errors
2 Stats cards visible Shows initiative count, sprint count, task count, overall progress
3 Phase summary cards 5 phase cards with correct labels and item counts
4 Phase styling pre_launch/at_launch/post_launch = full color, future/exploration = muted
5 Progress bars Show non-zero progress for phases with shipped tasks
6 Recent activity Shows changelog entries (at minimum seed creation events)
7 Quick action buttons "New Initiative", "New Sprint" buttons exist and link correctly
8 Sidebar navigation Roadmap section appears in admin sidebar with sub-links

Notes: **___**


2.2 Initiative Management

List (/admin/roadmap/initiatives)

# Test Expected Pass?
9 Page loads Table/grid shows seeded initiatives
10 Columns display Title, Category (icon+label), Phase, Priority, Progress, Sprint count
11 Filter by Phase Select "At Launch" → only at_launch initiatives shown
12 Filter by Category Select "Verification" → only verification initiatives shown
13 Clear filters Reset → all initiatives shown
14 Click row Navigates to initiative edit page
15 "New Initiative" button Navigates to create page

Create (/admin/roadmap/initiatives/new)

# Test Expected Pass?
16 Form loads All fields rendered: title, public title, description, public description, category, phase, priority, target date, visibility toggle
17 Category dropdown Grouped by section (Core Product, Platform, etc.)
18 Submit empty Validation error on required fields (title, category, phase)
19 Create initiative Fill title="UAT Test Initiative", category=tech_debt, phase=exploration, priority=low → Save → Redirects to edit page
20 Verify created Navigate back to list → new initiative appears

Edit (/admin/roadmap/initiatives/[id])

# Test Expected Pass?
21 Form pre-filled All fields show saved values
22 Edit title Change title → Save → Title updated
23 Edit phase Change phase → Save → Phase badge updates on list
24 Status override Set to "Paused" → Save → Shows paused indicator
25 Sprints section Lists associated sprints (if any) with progress bars
26 "Add Sprint" button Links to sprint create with initiative pre-selected
27 Delete initiative Click delete → Confirm → Redirects to list → Initiative gone
28 Delete orphan check After deleting initiative, its sprints still exist as standalone

Notes: **___**


2.3 Sprint Management

List (/admin/roadmap/sprints)

# Test Expected Pass?
29 Page loads Table shows seeded sprints
30 Columns display Title, Initiative (or "Standalone"), Category, Phase, Status, Progress, Tasks, Effort
31 Auto-derived status Sprints with all shipped tasks show "Shipped" badge
32 Mixed task status Sprints with mixed statuses show "In Progress"
33 Filter by Initiative Select specific initiative → shows only its sprints
34 Filter "Standalone only" Only sprints without initiative_id shown
35 Progress accurate Sprint with 3 of 4 tasks shipped shows ~75-85%

Create (/admin/roadmap/sprints/new)

# Test Expected Pass?
36 Form loads Initiative dropdown shows all initiatives + "Standalone"
37 Pre-selected initiative Navigate from initiative "Add Sprint" → initiative pre-selected
38 Create standalone Leave initiative blank → Save → Shows as "Standalone" in list
39 Create under initiative Select initiative → Save → Shows under that initiative

Edit (/admin/roadmap/sprints/[id])

# Test Expected Pass?
40 Form pre-filled All fields correct
41 Computed stats Status badge, progress bar, effort range shown
42 Effort display Shows "Min Xh — Expected Xh — Max Xh"
43 Tasks section Lists all tasks with status badges, hours, priority
44 Task sort order Tasks display in sort_order sequence
45 "Add Task" button Creates or navigates to task creation
46 Task click "Edit →" navigates to task edit page
47 Delete sprint Confirm → Sprint and all its tasks deleted

Notes: **___**


2.4 Task Management

Inline Status Changes (on Sprint edit page)

# Test Expected Pass?
48 Status badge clickable Clicking badge opens status dropdown
49 Change to in_development Select "In Dev" → Badge updates → startedAt populated
50 Change to shipped Select "Shipped" → Badge updates → completedAt populated
51 Change to paused Optionally prompts for reason → Badge shows ⏸ Paused
52 Progress updates After status change, sprint progress bar recalculates
53 Sprint status auto-derives After changing tasks, sprint status badge updates

Reordering (on Sprint edit page)

# Test Expected Pass?
54 Arrow buttons visible ↑↓ arrows on each task row
55 Move up Click ↑ → Task moves up in list
56 Move down Click ↓ → Task moves down in list
57 First task ↑ button disabled on first task
58 Last task ↓ button disabled on last task
59 Order persists Refresh page → Same order maintained

Task Edit Page (/admin/roadmap/tasks/[id])

# Test Expected Pass?
60 Page loads Form shows all task fields pre-filled
61 Breadcrumb Shows: Roadmap > Sprints > [Sprint] > [Task]
62 Sprint dropdown Can move task to different sprint → Save → Task appears in new sprint
63 Edit estimate Change hours to 16 → Save → Effort range recalculates
64 Edit multipliers Change max to 3.0 → Range expands
65 Changelog section Shows changes made to this task
66 Delete task Confirm → Task removed from sprint

Status Badge Colors

# Test Expected Pass?
67 Backlog Gray badge
68 Planning Blue badge
69 Ready Indigo badge
70 In Development Trust Blue (filled) badge
71 Review Purple badge
72 Testing Amber badge
73 Approved Green badge
74 Shipped Green (filled) with ✓
75 Paused Gray with ⏸
76 Stalled Red with ⚠
77 Cancelled Gray, strikethrough

Notes: **___**


2.5 Dependencies

# Test Expected Pass?
78 Page loads (/admin/roadmap/dependencies) Shows existing dependencies (if seeded) or empty state
79 Add dependency form Blocker type, blocker select, blocked type, blocked select, type, notes
80 Entity search Can search/filter sprints and tasks in dropdowns
81 Create hard dependency Select Sprint A blocks Sprint B → Save → Appears in table
82 Create soft dependency Select "Soft" type → Save → Shows yellow "Soft" badge
83 Cycle detection Try Sprint A blocks Sprint B when B already blocks A → Error: "circular dependency"
84 Self-reference prevention Try Sprint A blocks Sprint A → Rejected
85 Delete dependency Click delete → Confirm → Removed from table
86 Cross-type dependency Sprint blocks Task → Works
87 Task blocks Sprint Task blocks Sprint → Works

Notes: **___**


2.6 Changelog

Global Changelog (/admin/roadmap/changelog)

# Test Expected Pass?
88 Page loads Shows changelog entries, newest first
89 Entries from CRUD Creating/editing initiatives, sprints, tasks generated entries
90 Status changes logged Task status changes show "status: backlog → in_development"
91 Filter by entity type Select "Tasks" → only task changes shown
92 Entity links Click entity title → navigates to edit page
93 Change display Old value (red/struck) → New value (green)
94 Pagination If >50 entries, pagination controls work
95 Change reason Status changes with reasons show the reason text

Inline Changelog (on edit pages)

# Test Expected Pass?
96 Initiative edit Changelog section shows changes to this initiative only
97 Sprint edit Changelog section shows changes to this sprint only
98 Task edit Changelog section shows changes to this task only

Notes: **___**


2.7 Progress Rollup Accuracy

# Test Expected Pass?
99 All tasks backlog Sprint progress = 0%
100 All tasks shipped Sprint progress = 100%
101 Mixed statuses 2 shipped (100×2) + 1 in_dev (50) + 1 backlog (0) = 250/400 = 63%
102 Cancelled excluded Cancel a task → progress recalculates without it
103 Paused preserves weight Pause an in_dev task → weight stays at 50 (lastActiveWeight)
104 Initiative rollup Initiative progress = average of sprint progress values

Notes: **___**


2.8 Auth & Permissions

# Test Expected Pass?
105 Unauthenticated API curl without session → 401 or 403
106 Non-admin user Log in as regular user → /admin/roadmap → Redirected or 403
107 Admin access Log in as admin → Full access to all roadmap pages

Notes: **___**


2.9 Error Handling & Edge Cases

# Test Expected Pass?
108 Invalid initiative ID Navigate to /admin/roadmap/initiatives/fake-uuid → 404 or error page
109 Invalid sprint ID Navigate to /admin/roadmap/sprints/fake-uuid → 404 or error page
110 Invalid task ID Navigate to /admin/roadmap/tasks/fake-uuid → 404 or error page
111 Empty sprint Sprint with 0 tasks → Shows 0% progress, empty task list
112 No console errors Navigate through all pages → No red errors in browser console
113 Page refresh Edit a form → Refresh → Data persists (no stale state)

Notes: **___**


Part 3: Sign-Off

Results Summary

Section Tests Passed Failed Blocked
2.1 Dashboard 8
2.2 Initiatives 20
2.3 Sprints 19
2.4 Tasks 30
2.5 Dependencies 10
2.6 Changelog 11
2.7 Progress 6
2.8 Auth 3
2.9 Edge Cases 6
TOTAL 113

Blocking Issues (must fix before merge)

# Test Issue Severity

Non-Blocking Issues (can fix later)

# Test Issue Priority

Sign-Off

  • All blocking issues resolved
  • No console errors on any page
  • Type check passes
  • Lint passes
  • Build passes
  • Ready to merge to develop

Tester: **___** Date: **___** Branch Merge Approved: ☐ Yes ☐ No (list blockers)


Merge Checklist

After UAT passes:

# Ensure clean state
git checkout feature/roadmap-admin-interface
git pull origin feature/roadmap-admin-interface

# Final checks
npm run type-check
npm run lint
npm run build

# Merge to develop
git checkout develop
git pull origin develop
git merge feature/roadmap-admin-interface
git push origin develop

# Verify on staging
# Run seed on staging database
# Spot-check critical paths