DRAG DROP TESTING

Ecosistema completo para organización y gestión de contenido con interfaces espaciales

🧪 DRAG & DROP TESTING CHECKLIST

Date: November 10, 2025
Feature: Module Drag & Drop from Library to Canvas


✅ Code Verification - COMPLETE

Module Library Browser ✅

Universal Canvas ✅

Template Bindings ✅


🧪 Manual Testing Steps

Test 1: Basic Drag & Drop

  1. ✅ Open universe: http://localhost:4200/space/{space-slug}/universe-map
  2. ⏳ Verify module library sidebar is visible on the left
  3. ⏳ Drag a "Galaxy" module type card
  4. ⏳ Drop it onto the canvas
  5. ⏳ Expected: New galaxy module appears at drop position
  6. ⏳ Check console for logs: 📦 Setting drag data, 🎯 Canvas Drop Event, ✅ Module created

Test 2: Multiple Module Types

  1. ⏳ Drag "World" module → drop on canvas
  2. ⏳ Drag "Widget" module → drop on canvas
  3. ⏳ Drag "Navigation" module → drop on canvas
  4. ⏳ Expected: All modules created and visible

Test 3: Module Positioning

  1. ⏳ Drop module at different canvas positions
  2. ⏳ Expected: Module appears where dropped (accounting for card centering)
  3. ⏳ Refresh page
  4. ⏳ Expected: Module positions persist (flash storage)

Test 4: Visual Feedback

  1. ⏳ Drag module over canvas
  2. ⏳ Expected: Canvas highlights (.drag-over class adds purple border)
  3. ⏳ Drop module
  4. ⏳ Expected: Highlight disappears, module appears

Test 5: Move Mode

  1. ⏳ Toggle "Move Mode" OFF (default)
  2. ⏳ Try to drag existing module card
  3. ⏳ Expected: Module doesn't move (move mode disabled)
  4. ⏳ Toggle "Move Mode" ON
  5. ⏳ Drag existing module card
  6. ⏳ Expected: Module moves smoothly

Test 6: Layout Zones (if layout module exists)

  1. ⏳ Create a "Layout" module first
  2. ⏳ Expected: Canvas switches to zone mode (zones visible)
  3. ⏳ Drag module over a zone
  4. ⏳ Expected: Zone highlights purple
  5. ⏳ Drop module in zone
  6. ⏳ Expected: Module created with config.layoutZone set

🐛 Known Issues to Check

Issue 1: No Universe Context

Issue 2: CORS / Backend Connection

Issue 3: Module Service Not Found

Issue 4: Drag Data Not Set

Issue 5: Canvas Not Receiving Drops


📊 Console Log Markers

Look for these console logs during testing:

Drag Start (Module Library):

📦 Setting drag data: { type: 'module-type', moduleType: 'galaxy' }
📄 JSON string: {"type":"module-type","moduleType":"galaxy"}
✅ Drag data set successfully!

Drag Over (Canvas):

📦 Drag over canvas: { types: [...], clientX: X, clientY: Y }

Drop (Canvas):

🎯 Canvas Drop Event: DragEvent { ... }
📦 DataTransfer types: ['application/json', 'text/plain']
📄 JSON Data: {"type":"module-type","moduleType":"galaxy"}
📍 Creating module at position: { x: 123, y: 456 }

Module Creation:

✅ Module created: { id: 'mod_...', name: 'galaxy-1234567890', type: 'galaxy' }
📍 Module positioned at: { x: 123, y: 456, isManuallyPositioned: true }

🚨 If Drag & Drop Still Not Working

Debugging Steps:

  1. Open Browser DevTools (F12)

  2. Go to Console tab

  3. Try dragging a module

  4. Check for:

    • ✅ "Setting drag data" log (library component)
    • ✅ "Drag over canvas" log (canvas component)
    • ✅ "Canvas Drop Event" log (drop handler)
    • ❌ Any error messages
  5. If no logs appear:

    • Check if module library is rendering
    • Check if canvas is rendering
    • Inspect DOM to verify event handlers are bound
  6. If logs appear but module doesn't create:

    • Check "Cannot create module" warnings
    • Verify universeId is set
    • Check backend API response
    • Verify module service is working

🎯 Success Criteria

✅ Drag & drop is working when:

  1. Module card follows cursor during drag
  2. Canvas highlights when dragging over it
  3. Module appears on canvas at drop position
  4. Console shows all expected logs
  5. New module visible in DOM
  6. Page refresh preserves module position

🔧 Quick Fixes

If nothing works:

# Clear browser cache (Hard Refresh)
Ctrl + Shift + R (or Cmd + Shift + R on Mac)

# Clear NX cache
nx reset

# Restart dev server
# Kill process (Ctrl+C) then:
nx serve gograb-space

If module library not visible:

If canvas not accepting drops:


📝 Test Results (Fill in during testing)

Test Status Notes
Basic Drag & Drop ⏳
Multiple Module Types ⏳
Module Positioning ⏳
Visual Feedback ⏳
Move Mode ⏳
Layout Zones ⏳

Ready to test! Open the app and start dragging modules! 🚀