Last updated: Aug 12, 2025, 01:09 PM UTC

Testing Organization Setup Guide

Quick Start Testing

1. Reset Current User (Fastest)

# Soft reset - keep user, reset onboarding
./scripts/reset-onboarding.sh --soft

# Then login with your existing credentials

2. Create Test Users

# Create 3 test users quickly
node scripts/test-users.js quick

# This creates:
# - test-skip (password: test123)
# - test-upload (password: test123)  
# - test-complete (password: test123)

3. Docker Container Testing

# If using Docker, run commands inside container
docker exec sasha-test ./scripts/reset-onboarding.sh --soft
docker exec sasha-test node scripts/test-users.js quick

Testing Different Scenarios

Test 1: Skip Functionality

  1. Login as test-skip
  2. Click "Skip for now β†’"
  3. Verify workspace is created
  4. Go to Settings β†’ Organization
  5. Click "Launch Organization Setup"
  6. Verify it reopens

Test 2: Document Upload

  1. Login as test-upload
  2. Upload test documents (PDFs, Word, Excel)
  3. Watch processing animation
  4. Verify Claude auto-launches with research prompt
  5. Check ~/.claude/projects/default-workspace/docs/local/

Test 3: Complete Flow

  1. Login as test-complete
  2. Upload documents
  3. Fill in company details
  4. Complete setup
  5. Verify knowledge base creation

Browser Developer Tools

Clear Session Storage

// Run in browser console to trigger Organization Setup from Settings
sessionStorage.setItem('showOrganizationSetup', 'true');
location.reload();

Force Show Onboarding

// Run in browser console
localStorage.removeItem('auth-token');
sessionStorage.clear();
location.reload();

Test Documents

Create a test-docs folder with sample files:

mkdir -p test-docs
cd test-docs

# Create sample documents
echo "# Company Overview\nAcme Corp is a leading provider..." > company-overview.md
echo "# Employee Handbook\nWelcome to Acme Corp..." > employee-handbook.md
echo "# Product Catalog\nOur products include..." > products.md

# Convert to PDF if needed (on Mac)
# textutil -convert pdf *.md

Database Queries for Testing

# Check user onboarding status
sqlite3 server/database/auth.db "
SELECT u.username, cp.onboarding_completed, cp.company_name 
FROM users u 
LEFT JOIN company_profiles cp ON u.id = cp.user_id;
"

# Reset specific user
sqlite3 server/database/auth.db "
UPDATE company_profiles 
SET onboarding_completed = 0 
WHERE user_id = (SELECT id FROM users WHERE username = 'testuser');
"

# View uploaded documents
sqlite3 server/database/auth.db "
SELECT * FROM onboarding_documents;
"

Workspace Inspection

# Check workspace structure
tree ~/.claude/projects/default-workspace/

# View converted documents
ls -la ~/.claude/projects/default-workspace/docs/local/

# Check CLAUDE.md content
cat ~/.claude/projects/default-workspace/CLAUDE.md

Automated Testing Script

#!/bin/bash
# test-cycle.sh - Full test cycle

echo "πŸ§ͺ Starting Organization Setup Test Cycle"

# 1. Reset
./scripts/reset-onboarding.sh --soft

# 2. Open browser
open http://localhost:3005

# 3. Monitor workspace
watch -n 1 "ls -la ~/.claude/projects/default-workspace/docs/local/ 2>/dev/null || echo 'No workspace yet'"

Common Issues & Solutions

Issue: Onboarding doesn't show

# Fix: Reset onboarding status
./scripts/reset-onboarding.sh --soft

Issue: Documents won't upload

# Fix: Check uploads directory permissions
mkdir -p uploads/onboarding
chmod 755 uploads/onboarding

Issue: Claude doesn't auto-launch

// Fix: Check sessionStorage in browser console
sessionStorage.getItem('organizationResearchPrompt')

Issue: Settings shows wrong state

# Fix: Clear browser cache
# Chrome: Cmd+Shift+R (Mac) / Ctrl+Shift+R (Windows)

Testing Checklist

  • New user sees Organization Setup
  • Skip button works and creates workspace
  • Document upload accepts multiple files
  • Document conversion to Markdown works
  • Processing animation shows progress
  • Company details can be edited
  • Claude auto-launches with research prompt
  • Settings β†’ Organization tab works
  • Re-accessing setup from Settings works
  • Workspace structure is correct
  • Database fields are updated properly

Quick Reset Between Tests

# One-liner to reset and open
./scripts/reset-onboarding.sh --soft && open http://localhost:3005