Skip to content

Commit 322a7d3

Browse files
committed
refactor: Extract command handlers and improve test coverage
Major refactoring to improve code organization and testability: Command Handler Extraction: - Create lib/command-handlers.js with dependency injection pattern - Extract 19 commands: playback (9), queue (5), volume (2), search (3) - Reduce index.js by ~500 lines Queue Utilities: - Create lib/queue-utils.js for sorting and track utilities - Extract pure functions for better testability Test Infrastructure: - Add comprehensive mocks for Sonos, Slack, Discord, Spotify - New test files: auth-handler, command-handlers, discord, queue-utils, setconfig, slack - Expand voting.test.mjs with direct module tests - Total: 511 unit tests passing Integration Tests: - Expand from 21 to 70 integration tests - Add pre-flight checks for clean state validation - Add queue verification before/after modifications - Keep volume safe (max 20, reset to 5) - Fix all validators to match actual bot responses Bug Fixes: - Fix votecheck to show track metadata when track leaves queue - Store track title/artist when votes are cast
1 parent 0d2db7f commit 322a7d3

27 files changed

Lines changed: 5685 additions & 732 deletions

.github/workflows/feature-request-enhance.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,8 @@ jobs:
246246
-H "Accept: application/vnd.github+json" \
247247
-H "Content-Type: application/json" \
248248
-d @- \
249+
<<<<<<< HEAD
249250
"https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/comments"
251+
=======
252+
"https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/comments"
253+
>>>>>>> origin/master

app.manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@
6060

6161

6262

63+
64+
65+

docs/DISCORD_DISCOVERY_CONTENT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,6 @@ Join our Discord server for:
113113

114114

115115

116+
117+
118+

index.js

Lines changed: 186 additions & 606 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)