mantimon-tcg/frontend/PROJECT_PLAN_TEST_COVERAGE.json
Cal Corum 69daedfa02 Add Board tests - TEST-003 complete (55 tests)
Comprehensive testing of Board game object covering:
- Zone creation and layout management (with/without prizes)
- Zone highlighting (single, bulk, clear)
- Coordinate queries and hit detection
- Layout updates and resize handling
- Cleanup and lifecycle management

All tests passing (1,337 total, +55)

Test coverage:
- Constructor and initialization (3 tests)
- setLayout() zone rendering (7 tests)
- getLayout() retrieval (3 tests)
- highlightZone() single zone highlighting (6 tests)
- highlightAllZones() bulk highlighting (4 tests)
- clearHighlights() reset (3 tests)
- getZonePosition() queries (4 tests)
- isPointInZone() hit detection (4 tests)
- getZoneAtPoint() zone lookup (4 tests)
- destroy() cleanup (5 tests)
- createBoard() factory (3 tests)
- Integration scenarios (4 tests)
- Edge cases (5 tests)

Enhanced Phaser mocks:
- Added lineBetween() method to MockGraphics
- Added cameras property to test setup

Status: TEST-003 marked complete in project plan

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 15:45:36 -06:00

865 lines
41 KiB
JSON

{
"meta": {
"version": "1.0.3",
"created": "2026-02-02",
"lastUpdated": "2026-02-03",
"started": "2026-02-02",
"planType": "testing",
"description": "Test coverage improvement plan - filling critical gaps in game engine, WebSocket, and gameplay code",
"totalEstimatedHours": 120,
"totalTasks": 35,
"completedTasks": 6,
"currentCoverage": "~67%",
"targetCoverage": "85%",
"progress": {
"testsAdded": 337,
"totalTests": 1337,
"quickWinsCompleted": 3,
"quickWinsRemaining": 0,
"hoursSpent": 33,
"coverageGain": "+5%",
"branchStatus": "active",
"branchName": "test/coverage-improvements"
}
},
"categories": {
"critical": "Zero or critically low coverage (<30%) on production code",
"high": "Important gaps (30-60%) in core functionality",
"medium": "Quality improvements (60-80%) for completeness",
"low": "Polish and edge cases (80-90%)",
"infrastructure": "Testing infrastructure and tooling"
},
"tasks": [
{
"id": "TEST-001",
"name": "Create Phaser testing infrastructure",
"description": "Set up minimal Phaser mocks and testing utilities to enable testing of game engine code. Create reusable mock classes for Phaser.Scene, Phaser.Game, Phaser.GameObjects, etc. This is the foundation for all subsequent game engine tests.",
"category": "critical",
"priority": 1,
"completed": true,
"tested": true,
"dependencies": [],
"files": [
{
"path": "src/test/mocks/phaser.ts",
"lines": [1, 700],
"issue": "COMPLETE - Comprehensive Phaser mocks created (MockScene, MockGame, MockContainer, MockSprite, MockText, MockGraphics, MockEventEmitter)"
},
{
"path": "src/test/helpers/gameTestUtils.ts",
"lines": [1, 400],
"issue": "COMPLETE - Test utilities created (createMockGameState, createMockCard, setupMockScene, createGameScenario, etc.)"
},
{
"path": "src/test/mocks/phaser.spec.ts",
"lines": [1, 350],
"issue": "COMPLETE - Mock tests added (33 tests verifying mock API)"
},
{
"path": "src/test/helpers/gameTestUtils.spec.ts",
"lines": [1, 300],
"issue": "COMPLETE - Utility tests added (22 tests verifying helper functions)"
},
{
"path": "src/test/README.md",
"lines": [],
"issue": "COMPLETE - Documentation created for testing infrastructure"
}
],
"suggestedFix": "1. Create src/test/mocks/phaser.ts with MockScene, MockGame, MockSprite, MockGraphics classes\n2. Create src/test/helpers/gameTestUtils.ts with helper functions: createMockGameState(), createMockCard(), setupMockScene()\n3. Document mock API in test/README.md\n4. Add vitest setup file to auto-import mocks",
"estimatedHours": 8,
"notes": "This is a prerequisite for all Phaser-related tests. Use existing PhaserGame.spec.ts as reference for what mocks are needed. Keep mocks minimal - only mock what's necessary for tests to run."
},
{
"id": "TEST-002",
"name": "Test MatchScene initialization and lifecycle",
"description": "Test MatchScene.ts core functionality: scene creation, initialization, state setup, and cleanup. Cover the scene lifecycle from preload to shutdown.",
"category": "critical",
"priority": 2,
"completed": true,
"tested": true,
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/game/scenes/MatchScene.ts",
"lines": [1, 511],
"issue": "TESTED - Core lifecycle and event handling covered"
},
{
"path": "src/game/scenes/MatchScene.spec.ts",
"lines": [1, 600],
"issue": "COMPLETE - 26 tests covering initialization, events, state updates, resize, shutdown"
}
],
"suggestedFix": "1. Create MatchScene.spec.ts\n2. Test scene creation: verify scene key, config\n3. Test preload: asset loading calls\n4. Test create: board creation, event listeners setup\n5. Test shutdown: cleanup, event unsubscription\n6. Test update loop: state synchronization\n7. Mock gameBridge and verify event handling",
"estimatedHours": 8,
"notes": "Focus on initialization logic and event wiring. Don't test every animation frame - test that state changes trigger expected updates. Mock Board creation since Board tests are separate."
},
{
"id": "TEST-003",
"name": "Test Board layout and zone management",
"description": "Test Board.ts: zone creation, card placement, layout calculations, coordinate transformations. Verify zones are created correctly for different game modes (prize vs no-prize).",
"category": "critical",
"priority": 3,
"completed": true,
"tested": true,
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/game/objects/Board.ts",
"lines": [1, 611],
"issue": "COMPLETE - 611 lines now tested"
},
{
"path": "src/game/objects/Board.spec.ts",
"lines": [1, 730],
"issue": "COMPLETE - 55 tests created (constructor, setLayout, highlighting, zone queries, coordinate detection, destroy, factory function, integration, edge cases)"
},
{
"path": "src/test/mocks/phaser.ts",
"lines": [413, 417],
"issue": "ENHANCED - Added lineBetween() method to MockGraphics for center line rendering"
}
],
"suggestedFix": "✅ COMPLETE\n1. ✅ Created Board.spec.ts with 55 tests\n2. ✅ Test constructor and initialization\n3. ✅ Test setLayout() with prize zones (Pokemon TCG) and without (Mantimon TCG)\n4. ✅ Test zone highlighting (single, bulk, clear)\n5. ✅ Test zone position queries\n6. ✅ Test coordinate hit detection (isPointInZone, getZoneAtPoint)\n7. ✅ Test destroy cleanup\n8. ✅ Test createBoard factory\n9. ✅ Integration and edge cases",
"estimatedHours": 10,
"actualHours": 10,
"notes": "COMPLETE - Board is now fully tested. All 55 tests passing. Tests cover both game modes (with/without prizes), zone highlighting, coordinate queries, and lifecycle management."
},
{
"id": "TEST-004",
"name": "Test Card rendering and interactions",
"description": "Test Card.ts: card display, state updates (tapped, selected, damaged), click handling, drag interactions, animations. This is the most complex game object.",
"category": "critical",
"priority": 4,
"completed": false,
"tested": false,
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/game/objects/Card.ts",
"lines": [1, 832],
"issue": "0% coverage - 832 lines untested"
},
{
"path": "src/game/objects/Card.spec.ts",
"lines": [],
"issue": "File needs to be created"
}
],
"suggestedFix": "1. Create Card.spec.ts\n2. Test card creation: verify sprite, text, damage counter setup\n3. Test state updates: setTapped(), setSelected(), setDamaged()\n4. Test visual updates: tap rotation, selection highlight, damage display\n5. Test click handling: pointer events, interaction callbacks\n6. Test drag: drag start/end, position updates\n7. Test animations: flip, move, fade",
"estimatedHours": 12,
"notes": "Largest and most complex game object. Break into multiple test suites if needed: Card.rendering.spec.ts, Card.interactions.spec.ts, Card.animations.spec.ts. Mock Phaser graphics/tweens heavily."
},
{
"id": "TEST-005",
"name": "Test StateRenderer synchronization logic",
"description": "Test StateRenderer.ts: game state diffing, incremental updates, animation sequencing, error recovery. This is the bridge between backend state and Phaser rendering.",
"category": "critical",
"priority": 5,
"completed": false,
"tested": false,
"dependencies": ["TEST-001", "TEST-002", "TEST-003"],
"files": [
{
"path": "src/game/sync/StateRenderer.ts",
"lines": [1, 709],
"issue": "0% coverage - 709 lines untested"
},
{
"path": "src/game/sync/StateRenderer.spec.ts",
"lines": [],
"issue": "File needs to be created"
}
],
"suggestedFix": "1. Create StateRenderer.spec.ts\n2. Test render(): initial state rendering, creates all zones/cards\n3. Test update(): incremental state changes, only updates diffs\n4. Test card movement: card moves from hand to active zone\n5. Test card removal: card removed from board when discarded\n6. Test damage updates: damage counters update without full re-render\n7. Test error handling: gracefully handles malformed state\n8. Test Board creation: defers creation until state available (recent fix)",
"estimatedHours": 12,
"notes": "This is critical for correctness - bugs here cause desyncs. Test with realistic game state transitions. Mock MatchScene and Board. Verify optimization: don't re-render unchanged cards."
},
{
"id": "TEST-006",
"name": "Test Zone base class and zone types",
"description": "Test Zone.ts base class and subclasses (HandZone, BenchZone, ActiveZone, PrizeZone, PileZone): card capacity, layout, add/remove cards, sorting, hover effects.",
"category": "critical",
"priority": 6,
"completed": false,
"tested": false,
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/game/objects/Zone.ts",
"lines": [1, 458],
"issue": "0% coverage - 458 lines untested"
},
{
"path": "src/game/objects/HandZone.ts",
"lines": [1, 321],
"issue": "0% coverage - 321 lines untested"
},
{
"path": "src/game/objects/BenchZone.ts",
"lines": [1, 287],
"issue": "0% coverage - 287 lines untested"
},
{
"path": "src/game/objects/Zone.spec.ts",
"lines": [],
"issue": "File needs to be created"
}
],
"suggestedFix": "1. Create Zone.spec.ts for base class\n2. Test capacity: maxCards enforcement, isFull()\n3. Test card management: addCard(), removeCard(), clear()\n4. Test layout: cards positioned correctly, spacing\n5. Test hover effects: zone highlights on drag-over\n6. Create subclass specs: HandZone.spec.ts, BenchZone.spec.ts, etc.\n7. Test zone-specific behavior: hand fanning, bench slots",
"estimatedHours": 10,
"notes": "Zone is the base class for all card containers. Test inheritance - ensure subclasses properly extend base behavior. Mock Card objects to focus on zone logic."
},
{
"id": "TEST-007",
"name": "Test WebSocket client connection lifecycle",
"description": "Test socket/client.ts: connection establishment, disconnection, reconnection logic, authentication, error handling. Currently only 27% coverage - missing critical paths.",
"category": "critical",
"priority": 7,
"completed": false,
"tested": false,
"dependencies": [],
"files": [
{
"path": "src/socket/client.ts",
"lines": [182, 300],
"issue": "27% coverage - missing connection lifecycle tests"
},
{
"path": "src/socket/client.spec.ts",
"lines": [1, 300],
"issue": "Incomplete coverage - add lifecycle tests"
}
],
"suggestedFix": "1. Expand client.spec.ts\n2. Test connect(): successful connection, auth token passing\n3. Test disconnect(): clean disconnection, event cleanup\n4. Test reconnection: auto-reconnect on drop, exponential backoff\n5. Test connection errors: auth failure, network error, timeout\n6. Test event handlers: message routing, error propagation\n7. Test connection state: connected, disconnected, reconnecting states",
"estimatedHours": 6,
"notes": "WebSocket is critical for multiplayer. Test error scenarios thoroughly - connection drops are common. Mock socket.io-client and use fake timers for reconnection delays."
},
{
"id": "TEST-008",
"name": "Test useGameSocket action queueing and state sync",
"description": "Test useGameSocket.ts: game action emission, response handling, state synchronization, error recovery, connection status. Currently 45% coverage - missing error paths and edge cases.",
"category": "critical",
"priority": 8,
"completed": false,
"tested": false,
"dependencies": ["TEST-007"],
"files": [
{
"path": "src/composables/useGameSocket.ts",
"lines": [146, 464],
"issue": "45% coverage - missing action queueing and error handling"
},
{
"path": "src/composables/useGameSocket.spec.ts",
"lines": [1, 500],
"issue": "Incomplete coverage - add edge case tests"
}
],
"suggestedFix": "1. Expand useGameSocket.spec.ts\n2. Test sendAction(): action emission, callback registration\n3. Test action response: success callback, error callback\n4. Test action timeout: callback with timeout error\n5. Test state updates: gameState reactive updates on server events\n6. Test connection recovery: queued actions resent after reconnect\n7. Test concurrent actions: multiple actions in flight\n8. Test invalid actions: server validation errors",
"estimatedHours": 8,
"notes": "This composable is the main game interaction interface. Test race conditions and concurrent actions. Mock socket client. Verify state updates trigger Vue reactivity."
},
{
"id": "TEST-009",
"name": "Test useGames game creation and management",
"description": "Test useGames.ts: createGame(), fetchActiveGames(), joinGame(), game state management. Currently only 2% coverage - almost completely untested.",
"category": "critical",
"priority": 9,
"completed": false,
"tested": false,
"dependencies": [],
"files": [
{
"path": "src/composables/useGames.ts",
"lines": [67, 257],
"issue": "2% coverage - core game management untested"
},
{
"path": "src/composables/useGames.spec.ts",
"lines": [],
"issue": "File needs to be created"
}
],
"suggestedFix": "1. Create useGames.spec.ts\n2. Test createGame(): API call, loading states, success response\n3. Test createGame() error: validation error, server error\n4. Test fetchActiveGames(): retrieve user's active games\n5. Test joinGame(): join existing game, reconnection\n6. Test game list management: add/remove/update games\n7. Test loading states: isLoading, isCreating flags\n8. Test error states: error messages, clearError()",
"estimatedHours": 6,
"notes": "Critical for game flow. Mock apiClient. Test the full game lifecycle: create → join → play → end. Verify error handling - game creation can fail for many reasons (invalid deck, no opponent, etc.)."
},
{
"id": "TEST-010",
"name": "Test PreloadScene asset loading",
"description": "Test PreloadScene.ts: asset manifest parsing, loading progress, error handling, transition to MatchScene. Currently 0% coverage.",
"category": "high",
"priority": 10,
"completed": false,
"tested": false,
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/game/scenes/PreloadScene.ts",
"lines": [1, 404],
"issue": "0% coverage - 404 lines untested"
},
{
"path": "src/game/scenes/PreloadScene.spec.ts",
"lines": [],
"issue": "File needs to be created"
}
],
"suggestedFix": "1. Create PreloadScene.spec.ts\n2. Test preload(): loads all assets from manifest\n3. Test loading progress: progress events, progress bar updates\n4. Test loading errors: handle missing assets, network errors\n5. Test scene transition: starts MatchScene after load complete\n6. Test caching: verify assets cached correctly\n7. Mock Phaser.Loader and asset loading",
"estimatedHours": 4,
"notes": "Lower priority than MatchScene but still important for user experience. Test error handling - network failures during load should be graceful. Mock all asset loading."
},
{
"id": "TEST-011",
"name": "Test HandManager drag and drop logic",
"description": "Test HandManager.ts: card dragging, drop validation, snap-back on invalid drop, touch events. Currently 39% coverage - missing edge cases.",
"category": "high",
"priority": 11,
"completed": false,
"tested": false,
"dependencies": ["TEST-004"],
"files": [
{
"path": "src/game/interactions/HandManager.ts",
"lines": [1, 572],
"issue": "39% coverage - missing drag edge cases"
},
{
"path": "src/game/interactions/HandManager.spec.ts",
"lines": [1, 300],
"issue": "Incomplete coverage - add edge case tests"
}
],
"suggestedFix": "1. Expand HandManager.spec.ts\n2. Test drag start: card pickup, visual feedback\n3. Test drag move: card follows pointer, over valid zone\n4. Test drag drop: valid drop, invalid drop (snap back)\n5. Test drag cancel: ESC key, right-click\n6. Test touch events: touch drag works on mobile\n7. Test multi-touch: handle multi-touch gracefully\n8. Test zone validation: can't drop on full zone",
"estimatedHours": 6,
"notes": "Important for UX - drag/drop is primary interaction. Test touch events separately with touch simulation. Verify snap-back animation on invalid drops."
},
{
"id": "TEST-012",
"name": "Test damage counter display and updates",
"description": "Test DamageCounter.ts: damage display, number formatting, positioning, animations. Currently 0% coverage.",
"category": "high",
"priority": 12,
"completed": false,
"tested": false,
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/game/objects/DamageCounter.ts",
"lines": [1, 202],
"issue": "0% coverage - 202 lines untested"
},
{
"path": "src/game/objects/DamageCounter.spec.ts",
"lines": [],
"issue": "File needs to be created"
}
],
"suggestedFix": "1. Create DamageCounter.spec.ts\n2. Test counter creation: initial damage value, position\n3. Test damage updates: setDamage(), increment, decrement\n4. Test display: zero damage hidden, non-zero visible\n5. Test positioning: counter positioned on card correctly\n6. Test animations: damage change animation, pulse effect\n7. Mock Phaser.GameObjects.Text and Graphics",
"estimatedHours": 3,
"notes": "Important visual feedback for game state. Test edge cases: 0 damage, very high damage (999+), negative damage (should never happen but handle gracefully)."
},
{
"id": "TEST-013",
"name": "Test asset loader and manifest",
"description": "Test assets/loader.ts and assets/manifest.ts: asset path resolution, manifest parsing, preload hooks. Currently 0% coverage.",
"category": "high",
"priority": 13,
"completed": false,
"tested": false,
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/game/assets/loader.ts",
"lines": [1, 326],
"issue": "0% coverage - 326 lines untested"
},
{
"path": "src/game/assets/manifest.ts",
"lines": [1, 190],
"issue": "0% coverage - 190 lines untested"
},
{
"path": "src/game/assets/loader.spec.ts",
"lines": [],
"issue": "File needs to be created"
}
],
"suggestedFix": "1. Create loader.spec.ts and manifest.spec.ts\n2. Test manifest parsing: correct asset paths, keys\n3. Test loader: loads assets in correct order\n4. Test asset types: images, audio, JSON, atlas\n5. Test path resolution: base URL handling\n6. Test error handling: missing manifest, invalid paths\n7. Mock Phaser.Loader methods",
"estimatedHours": 4,
"notes": "Important for initialization. Test manifest structure validation - invalid manifests should fail fast with helpful errors. Mock all actual file loading."
},
{
"id": "TEST-014",
"name": "Test ResizeManager responsive layout",
"description": "Test ResizeManager.ts: window resize handling, orientation changes, layout recalculation, mobile vs desktop. Currently 0% coverage.",
"category": "high",
"priority": 14,
"completed": false,
"tested": false,
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/game/ResizeManager.ts",
"lines": [1, 253],
"issue": "0% coverage - 253 lines untested"
},
{
"path": "src/game/ResizeManager.spec.ts",
"lines": [],
"issue": "File needs to be created"
}
],
"suggestedFix": "1. Create ResizeManager.spec.ts\n2. Test resize handling: window resize triggers layout update\n3. Test orientation change: portrait ↔ landscape\n4. Test layout calculation: correct scaling for different sizes\n5. Test debouncing: resize events debounced\n6. Test mobile detection: detects mobile vs desktop\n7. Mock window.innerWidth/Height and ResizeObserver",
"estimatedHours": 4,
"notes": "Important for mobile support. Test both portrait and landscape orientations. Verify debouncing - don't recalculate layout on every pixel change."
},
{
"id": "TEST-015",
"name": "Test CardBack placeholder rendering",
"description": "Test CardBack.ts: face-down card display, back texture, positioning. Currently 0% coverage but simple component.",
"category": "medium",
"priority": 15,
"completed": true,
"tested": true,
"completedDate": "2026-02-02",
"actualHours": 2,
"testsAdded": 25,
"coverageAfter": "~95%",
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/game/objects/CardBack.ts",
"lines": [1, 238],
"issue": "0% coverage - 238 lines untested"
},
{
"path": "src/game/objects/CardBack.spec.ts",
"lines": [],
"issue": "File needs to be created"
}
],
"suggestedFix": "1. Create CardBack.spec.ts\n2. Test creation: card back sprite, texture key\n3. Test positioning: correct position and scale\n4. Test visibility: shown for face-down cards\n5. Test flip animation: flip to reveal front\n6. Mock Phaser.GameObjects.Sprite",
"estimatedHours": 2,
"notes": "Relatively simple component. Lower priority than Card.ts but still needs coverage. Test flip animation timing and easing."
},
{
"id": "TEST-016",
"name": "Test user store profile management",
"description": "Test stores/user.ts: profile updates, linked account management, session handling. Currently 52% coverage - missing edge cases.",
"category": "medium",
"priority": 16,
"completed": true,
"tested": true,
"completedDate": "2026-02-02",
"actualHours": 3,
"testsAdded": 20,
"coverageAfter": "~90%",
"dependencies": [],
"files": [
{
"path": "src/stores/user.ts",
"lines": [98, 139],
"issue": "52% coverage - missing profile update edge cases"
},
{
"path": "src/stores/user.spec.ts",
"lines": [1, 200],
"issue": "Incomplete coverage - add edge case tests"
}
],
"suggestedFix": "1. Expand user.spec.ts\n2. Test profile update: updateProfile() success and error\n3. Test validation: invalid display name, invalid avatar URL\n4. Test linked accounts: add/remove linked accounts\n5. Test session management: active sessions, logout all\n6. Test concurrent updates: multiple profile updates in flight\n7. Mock API calls",
"estimatedHours": 3,
"notes": "Medium priority - basic functionality is tested, need edge cases. Test validation thoroughly - what happens with empty/null/very long display names?"
},
{
"id": "TEST-017",
"name": "Test useDragDrop edge cases",
"description": "Test composables/useDragDrop.ts: edge cases in drag/drop, touch events, multi-touch handling. Currently 76% coverage - good but can improve.",
"category": "medium",
"priority": 17,
"completed": false,
"tested": false,
"dependencies": [],
"files": [
{
"path": "src/composables/useDragDrop.ts",
"lines": [326, 424],
"issue": "76% coverage - missing edge cases"
},
{
"path": "src/composables/useDragDrop.spec.ts",
"lines": [1, 450],
"issue": "Good coverage but add edge cases"
}
],
"suggestedFix": "1. Expand useDragDrop.spec.ts\n2. Test edge case: drag start outside draggable\n3. Test edge case: drop outside any drop zone\n4. Test edge case: multiple simultaneous drags\n5. Test touch: touch drag on mobile devices\n6. Test touch: pinch-to-zoom during drag\n7. Test accessibility: keyboard drag (space/enter)",
"estimatedHours": 3,
"notes": "Already has good coverage (76%), focus on edge cases. Test keyboard accessibility - drag/drop should work with keyboard for a11y."
},
{
"id": "TEST-018",
"name": "Test deck builder page edge cases",
"description": "Test DeckBuilderPage.vue and related components: edge cases in deck validation, card limits, energy management. Currently 54-79% coverage.",
"category": "medium",
"priority": 18,
"completed": false,
"tested": false,
"dependencies": [],
"files": [
{
"path": "src/components/deck/DeckActionButtons.vue",
"lines": [64, 86],
"issue": "54% coverage - missing validation edge cases"
},
{
"path": "src/components/deck/DeckHeader.vue",
"lines": [32, 35],
"issue": "71% coverage - missing error states"
},
{
"path": "src/components/deck/DeckCardRow.vue",
"lines": [50, 186],
"issue": "79% coverage - missing interaction edge cases"
},
{
"path": "src/pages/DeckBuilderPage.vue",
"lines": [157, 290],
"issue": "76% coverage - missing error handling"
}
],
"suggestedFix": "1. Expand deck builder tests\n2. Test validation: deck too small, deck too large\n3. Test validation: too many copies of one card\n4. Test validation: invalid Pokemon (evolves without basic)\n5. Test energy: add/remove energy, energy limits\n6. Test save: save success, save error (network fail)\n7. Test delete: delete confirmation, delete error",
"estimatedHours": 4,
"notes": "Deck builder has good basic coverage, need edge cases. Test error states thoroughly - what happens when save fails mid-edit? Test undo/redo if implemented."
},
{
"id": "TEST-019",
"name": "Test HomePage, CampaignPage, MatchPage",
"description": "Test main user-facing pages: navigation, state loading, error states. Currently 0% coverage on these pages.",
"category": "medium",
"priority": 19,
"completed": false,
"tested": false,
"dependencies": [],
"files": [
{
"path": "src/pages/HomePage.vue",
"lines": [1, 200],
"issue": "0% coverage - page untested"
},
{
"path": "src/pages/CampaignPage.vue",
"lines": [1, 300],
"issue": "0% coverage - page untested"
},
{
"path": "src/pages/MatchPage.vue",
"lines": [1, 250],
"issue": "0% coverage - page untested"
}
],
"suggestedFix": "1. Create HomePage.spec.ts, CampaignPage.spec.ts, MatchPage.spec.ts\n2. Test HomePage: renders welcome message, navigation links\n3. Test CampaignPage: loads campaign data, displays clubs\n4. Test CampaignPage: click club navigates to matches\n5. Test MatchPage: loads match data, displays opponent\n6. Test error states: 404 game not found, loading errors\n7. Mock router and API calls",
"estimatedHours": 6,
"notes": "Page tests are integration tests - test user flows, not implementation details. Focus on happy path and error states. Mock all API calls and router."
},
{
"id": "TEST-020",
"name": "Test socket message factory functions",
"description": "Test socket/types.ts: message factory functions (createJoinGameMessage, createActionMessage, etc). Lines 308-361 were factory functions, not type guards.",
"category": "low",
"priority": 20,
"completed": true,
"tested": true,
"completedDate": "2026-02-02",
"actualHours": 2,
"testsAdded": 20,
"coverageAfter": "100%",
"dependencies": [],
"files": [
{
"path": "src/socket/types.ts",
"lines": [308, 361],
"issue": "0% coverage - type guards untested"
},
{
"path": "src/socket/types.spec.ts",
"lines": [1, 400],
"issue": "Has tests but missing type guards"
}
],
"suggestedFix": "1. Check if lines 308-361 contain runtime type guards\n2. If so, expand types.spec.ts to test them\n3. Test type guards: isGameStateMessage(), isActionResultMessage()\n4. Test invalid input: null, undefined, wrong shape\n5. Test edge cases: missing optional fields, extra fields",
"estimatedHours": 2,
"notes": "Only test if there are runtime type guards. Type-only definitions don't need tests. Type guards are important for robustness - ensure they catch malformed messages."
},
{
"id": "TEST-021",
"name": "Test game animation sequences",
"description": "Create integration tests for common game animation sequences: card played, attack, knockout, prize drawn. Test that animations play in correct order and complete.",
"category": "medium",
"priority": 21,
"completed": false,
"tested": false,
"dependencies": ["TEST-002", "TEST-004", "TEST-005"],
"files": [
{
"path": "src/game/animations/sequences.spec.ts",
"lines": [],
"issue": "File needs to be created - integration tests for animations"
}
],
"suggestedFix": "1. Create sequences.spec.ts for integration tests\n2. Test card played: hand → active, animation completes\n3. Test attack: attacker animates toward defender, damage applied\n4. Test knockout: defender fades out, moved to discard\n5. Test prize drawn: prize flips, moves to hand\n6. Test game over: victory/defeat animation\n7. Use fake timers to control animation timing",
"estimatedHours": 6,
"notes": "Integration tests - test animation sequences end-to-end. Use vitest fake timers to advance animation frames. These tests ensure animations complete and don't get stuck."
},
{
"id": "TEST-022",
"name": "Set up visual regression testing infrastructure",
"description": "Set up Playwright for visual regression testing of Phaser game. Take screenshots of game states and compare to baselines. This catches visual bugs that unit tests miss.",
"category": "infrastructure",
"priority": 22,
"completed": false,
"tested": false,
"dependencies": [],
"files": [
{
"path": "playwright.config.ts",
"lines": [],
"issue": "File needs to be created - Playwright config"
},
{
"path": "tests/visual/game.spec.ts",
"lines": [],
"issue": "File needs to be created - visual regression tests"
}
],
"suggestedFix": "1. Install Playwright: npm install -D @playwright/test\n2. Create playwright.config.ts with screenshot config\n3. Create tests/visual/ directory for visual tests\n4. Create baseline: npm run test:visual:update\n5. Test game board: screenshot of initial state\n6. Test game state: screenshot of mid-game state\n7. Test animations: screenshot at key animation frames\n8. Compare: fail if screenshots differ from baseline",
"estimatedHours": 8,
"notes": "Visual regression testing is essential for Phaser - catches layout bugs, rendering glitches, animation issues that unit tests can't detect. Keep baselines in Git. Run in CI to catch regressions."
},
{
"id": "TEST-023",
"name": "Add coverage reporting to CI",
"description": "Configure CI to generate coverage reports, post to PRs, fail if coverage drops. Track coverage over time.",
"category": "infrastructure",
"priority": 23,
"completed": false,
"tested": false,
"dependencies": [],
"files": [
{
"path": ".github/workflows/test.yml",
"lines": [],
"issue": "Needs coverage reporting step"
}
],
"suggestedFix": "1. Add coverage flag to CI test command: npm run test -- --coverage\n2. Upload coverage to Codecov or similar service\n3. Add coverage badge to README\n4. Configure PR comments with coverage diff\n5. Set minimum coverage threshold: fail if <80%\n6. Track coverage trends over time",
"estimatedHours": 3,
"notes": "Infrastructure improvement - makes coverage visible to team. Set threshold but don't be too strict initially (current 63%, target 80%). Use a service like Codecov, Coveralls, or GitHub Actions built-in."
},
{
"id": "TEST-024",
"name": "Document testing patterns and guidelines",
"description": "Create comprehensive testing documentation: how to write Phaser tests, common patterns, mocking strategies, debugging tips.",
"category": "infrastructure",
"priority": 24,
"completed": false,
"tested": false,
"dependencies": ["TEST-001"],
"files": [
{
"path": "src/test/README.md",
"lines": [],
"issue": "File needs to be created - testing guide"
}
],
"suggestedFix": "1. Create src/test/README.md\n2. Document Phaser testing patterns: how to mock scenes/objects\n3. Document common test utilities: gameTestUtils API\n4. Document integration testing: how to test sequences\n5. Add examples: good test vs bad test\n6. Add debugging tips: how to debug failing tests\n7. Link to Vitest and Phaser testing resources",
"estimatedHours": 4,
"notes": "Documentation is essential for team - makes it easy for others to write tests. Include real examples from the codebase. Keep updated as patterns evolve."
},
{
"id": "TEST-025",
"name": "Add mutation testing with Stryker",
"description": "Set up Stryker mutation testing to verify test quality. Mutation testing detects weak tests by injecting bugs and checking if tests catch them.",
"category": "infrastructure",
"priority": 25,
"completed": false,
"tested": false,
"dependencies": [],
"files": [
{
"path": "stryker.conf.json",
"lines": [],
"issue": "File needs to be created - Stryker config"
}
],
"suggestedFix": "1. Install Stryker: npm install -D @stryker-mutator/core @stryker-mutator/vitest-runner\n2. Create stryker.conf.json\n3. Configure mutators: arithmetic, conditionals, remove statements\n4. Run initial mutation test: npm run test:mutation\n5. Review results: identify weak tests\n6. Improve tests to catch mutations\n7. Add to CI (optional, slow)",
"estimatedHours": 6,
"notes": "Advanced testing technique - lower priority. Mutation testing is slow but valuable for critical code. Start with small modules (game/layout, game/config) before running on entire codebase."
}
],
"quickWins": [
{
"taskId": "TEST-015",
"estimatedMinutes": 120,
"impact": "CardBack is simple and quick to test - gets game/ directory coverage started"
},
{
"taskId": "TEST-020",
"estimatedMinutes": 120,
"impact": "Type guards are straightforward to test - improves socket reliability"
},
{
"taskId": "TEST-016",
"estimatedMinutes": 180,
"impact": "User store edge cases - improves coverage from 52% to 90%+"
}
],
"productionBlockers": [
{
"taskId": "TEST-005",
"reason": "StateRenderer synchronization bugs cause game state desyncs between players"
},
{
"taskId": "TEST-007",
"reason": "WebSocket connection issues can make multiplayer games unplayable"
},
{
"taskId": "TEST-008",
"reason": "Action queueing bugs can cause lost actions or duplicate actions"
}
],
"weeklyRoadmap": {
"week1": {
"theme": "Phaser Testing Infrastructure & Core Objects",
"goals": "Establish Phaser testing foundation, test core game objects",
"tasks": ["TEST-001", "TEST-003", "TEST-006", "TEST-015"],
"estimatedHours": 28,
"deliverables": "Phaser mocks, Board tests, Zone tests, CardBack tests"
},
"week2": {
"theme": "Phaser Scenes & State Synchronization",
"goals": "Test scene lifecycle and state rendering",
"tasks": ["TEST-002", "TEST-004", "TEST-005"],
"estimatedHours": 32,
"deliverables": "MatchScene tests, Card tests, StateRenderer tests"
},
"week3": {
"theme": "WebSocket & Network Layer",
"goals": "Complete WebSocket testing, ensure reliable multiplayer",
"tasks": ["TEST-007", "TEST-008", "TEST-009"],
"estimatedHours": 20,
"deliverables": "Socket client tests, useGameSocket tests, useGames tests"
},
"week4": {
"theme": "Game Engine Completion",
"goals": "Test remaining game engine components",
"tasks": ["TEST-010", "TEST-011", "TEST-012", "TEST-013", "TEST-014"],
"estimatedHours": 21,
"deliverables": "PreloadScene, HandManager, DamageCounter, AssetLoader, ResizeManager tests"
},
"week5": {
"theme": "UI & Integration Testing",
"goals": "Test pages and integration scenarios",
"tasks": ["TEST-016", "TEST-017", "TEST-018", "TEST-019", "TEST-021"],
"estimatedHours": 22,
"deliverables": "Page tests, edge case tests, animation sequence tests"
},
"week6": {
"theme": "Infrastructure & Polish",
"goals": "Set up visual regression, improve testing infrastructure",
"tasks": ["TEST-020", "TEST-022", "TEST-023", "TEST-024"],
"estimatedHours": 21,
"deliverables": "Playwright setup, CI coverage, testing documentation"
}
},
"milestones": [
{
"name": "Phaser Testing Enabled",
"completionCriteria": "TEST-001 complete, can write Phaser tests easily",
"targetDate": "End of Week 1",
"blockedBy": []
},
{
"name": "Core Game Engine Tested",
"completionCriteria": "MatchScene, Board, Card, StateRenderer all >70% coverage",
"targetDate": "End of Week 2",
"blockedBy": ["Phaser Testing Enabled"]
},
{
"name": "Network Layer Solid",
"completionCriteria": "Socket and WebSocket code >80% coverage, multiplayer reliable",
"targetDate": "End of Week 3",
"blockedBy": []
},
{
"name": "Game Engine Complete",
"completionCriteria": "All game/ directory files >60% coverage",
"targetDate": "End of Week 4",
"blockedBy": ["Core Game Engine Tested"]
},
{
"name": "Overall 75% Coverage",
"completionCriteria": "Project-wide coverage reaches 75%",
"targetDate": "End of Week 5",
"blockedBy": ["Game Engine Complete", "Network Layer Solid"]
},
{
"name": "Testing Infrastructure Mature",
"completionCriteria": "Visual regression working, CI coverage tracking, good documentation",
"targetDate": "End of Week 6",
"blockedBy": []
}
],
"coverageTargets": {
"current": {
"overall": "63%",
"game": "0%",
"composables": "84%",
"components": "90%",
"stores": "88%",
"socket": "27%"
},
"week2": {
"overall": "68%",
"game": "40%",
"composables": "84%",
"components": "90%",
"stores": "88%",
"socket": "27%"
},
"week4": {
"overall": "73%",
"game": "60%",
"composables": "86%",
"components": "90%",
"stores": "90%",
"socket": "80%"
},
"week6": {
"overall": "78%",
"game": "65%",
"composables": "90%",
"components": "92%",
"stores": "92%",
"socket": "85%"
},
"target_3months": {
"overall": "85%",
"game": "80%",
"composables": "95%",
"components": "95%",
"stores": "95%",
"socket": "90%"
}
},
"notes": {
"phaserTesting": "Phaser testing is the biggest challenge. The infrastructure task (TEST-001) is critical - invest time here to make all subsequent tests easier. Consider extracting game logic from Phaser where possible (pure functions easier to test).",
"visualRegression": "Visual regression testing (TEST-022) is optional but highly recommended for Phaser. Screenshots catch layout bugs, rendering glitches, and animation issues that unit tests miss.",
"prioritization": "Focus on critical tasks first (TEST-001 through TEST-009). These are production-critical: game engine and network layer. Medium/low priority tasks can wait.",
"incrementalApproach": "Don't try to achieve 100% coverage immediately. 85% is a realistic target. Some code is hard to test (animation frames, WebGL shaders) - focus on logic and state management.",
"teamVelocity": "Estimates assume one developer. With 2-3 developers, can complete in 3-4 weeks instead of 6. Assign game engine to one person, network layer to another."
}
}