deckhearth/TESTING_GUIDE.md
varutasu 9abbab6c21
feat(brand): unify on Deck Hearth across in-repo strings + infra (P1 brand decision)
Resolves the launch-blocking 'TCG Vault vs Deck Hearth' inconsistency called out in AGENTS.md line 5 since project setup. Operator gate-0 decision: Deck Hearth wins. Two briefs applied serially. B1 (mechanical): 7-file display + comment sweep. B2 (infrastructure): Redis prefix rename in lib/rate-limit.js (5 prefixes, accept one-time counter reset), package.json + lockfile regen (STOP-on-churn confirmed only name lines changed), admin/alice/bob email rename in seed scripts + login pre-fill + NEW idempotent migration script scripts/migrations/2026-05-24-rename-admin-email.js. Risk 4 PRESERVE applied: test/lib/permission-middleware.test.js retains admin@tcgvault.com literal with 7-line architect-authored why comment (documents pre-fix-auth-bypass bug shape; preserves historical truth per project's gotcha-documentation convention). All 5 D-decisions ratified at gate-1 (Deck Hearth / deck-hearth / deckhearth / admin@deckhearth.com / full deckhearth Redis prefix). Local: lint 128 baseline (B1 + B2), vitest 21/21 (B1 + B2). CI all green: Playwright smoke 3/3 against rebranded preview in 1m4s, forbidden-cors-headers pass, forbidden-endpoints pass, Screenshot diff pass, Vercel deployment complete. Cross-validation lineage: 4th convoy where the same 3-test smoke spec defends auth surface through sweeping change (after PR #15 Layout default-user, PR #19 CORS, PR #20 rate-limit, now this PR #21 brand rename). OPERATOR POST-MERGE ACTION REQUIRED: run 'node scripts/migrations/2026-05-24-rename-admin-email.js' against prod Neon DB before next admin login (ordering: migration FIRST, then any subsequent setup-db invocation). Migration is ESM, idempotent, UNIQUE-collision-safe. PR #21 architect-commit 50ce9ab, B1 ac8c998, B2 1c18d21.
2026-05-25 02:28:29 -05:00

3.5 KiB

🎯 Deck Hearth Collaboration Testing Guide

👥 Test Accounts

User Email Password Role
Admin admin@deckhearth.com admin123 Admin
Alice alice@deckhearth.com alice123 User
Bob bob@deckhearth.com bob123 User

🃏 Sample Cards Available

  • Lightning Bolt (MTG) - $2.50
  • Black Lotus (MTG) - $25,000
  • Pikachu (Pokemon) - $8.50
  • Charizard (Pokemon) - $350
  • Mickey Mouse (Lorcana) - $45
  • Elsa (Lorcana) - $15.75

🧪 Testing Workflow

1. Login as Alice

Email: alice@deckhearth.com
Password: alice123

2. Create a Collection

  • Go to /collections
  • Click "Create Collection"
  • Fill out:
    • Name: "Alice's Pokemon Collection"
    • Description: "My favorite Pokemon cards"
    • Image: (optional) https://images.unsplash.com/photo-1606092195730-5d7b9af1efc5?w=1200
    • Show in Community: Toggle ON for public visibility

3. Add Cards to Collection

  • Navigate to the new collection (auto-redirect after creation)
  • Use "Quick Add" search in empty state
  • Search for "Pikachu" and click to add
  • Search for "Charizard" and click to add
  • See real-time collection value updates

4. Invite Bob as Collaborator

  • Click "Invite Collaborator" button
  • Enter: bob@deckhearth.com
  • Role: Collaborator (default)
  • Message: "Help me build this Pokemon collection!"
  • Click "Send Invitation"

5. Switch to Bob's Account

  • Logout and login as Bob
  • Email: bob@deckhearth.com
  • Password: bob123

6. Accept Invitation (Simulated)

Since we're testing locally, simulate email acceptance:

  • Go to: /invite/accept?token=MOCK_TOKEN
  • Or manually add Bob to Alice's collection via database

7. Test Collaboration

As Bob:

  • Go to /collections - should see Alice's collection
  • Open Alice's collection
  • Add more cards using Quick Add
  • See Bob's activity in collaboration panel

8. Test Permission Levels

  • Bob can add/edit cards (Collaborator role)
  • Bob cannot delete collection (only Alice can)
  • Collection shows as "Public" but editing requires invitation

🔧 Quick Database Commands

Add Bob to Alice's Collection Manually:

-- Get collection ID (usually 1 for first collection)
SELECT id FROM collections WHERE name LIKE '%Alice%';

-- Add Bob as collaborator
INSERT INTO collection_permissions (collection_id, user_id, role, status)
VALUES (1, 3, 'editor', 'active');

Check Users:

node scripts/list-users.js

🎯 What to Test

Collection Management:

  • Create collection with image and visibility
  • Real-time stats (card count, value)
  • Only see your own collections initially

Card Management:

  • Search and add cards via Quick Add
  • Real card data with images and prices
  • Collection value updates automatically

Collaboration:

  • Invite collaborators with email
  • Permission indicators throughout UI
  • Activity logging for all changes

User Experience:

  • Beautiful empty states with guidance
  • Real-time search with dropdown results
  • Success confirmations and navigation
  • Permission-based UI elements

🚀 Ready to Test!

The system now provides a complete, real-world testing environment with:

  • Real user authentication
  • Database-driven collections and cards
  • Working collaboration system
  • Beautiful UX with proper empty states
  • Permission-based access control

Start testing by logging in as Alice and creating your first collection! 🎮