test(bot): cover untested music player-state and giveaway commands
What
Adds 81 tests (5 spec files) for previously-untested HIGH-risk bot commands surfaced by a test-health audit.
| File | Tests | Covers |
|---|---|---|
music/commands/pause.spec.ts | 14 | pause/resume state transitions, validation chain, embeds |
music/commands/replay.spec.ts | 14 | DJ permission chain, seek-to-zero, validation paths |
music/commands/remove.spec.ts | 16 | position validation (0/1-based), empty queue, boundaries |
music/commands/clear.spec.ts | 14 | track-count logging, error handling, ephemeral replies |
general/commands/giveaway.spec.ts | 23 | start/end/reroll, winner selection, DB cleanup, ManageGuild gate |
Why
These are core, high-velocity paths (player/queue state mutation, giveaway winner selection + permissions) that had zero coverage. Music commands use the existing commandValidations.ts seam; tests mirror the existing music-command spec patterns.
Verification
Spec-only diff (no source changed). Bot suite green:
Test Suites: 1 skipped, 225 passed, 225 of 226 total
Tests: 1 skipped, 3021 passed, 3022 total
Out of scope (follow-up)
Still-untested groups deferred to a separate PR: moderation (12/17), download (0/2), general (11/20).
Summary by cubic
Adds 81 behavior-covering tests for high-risk music commands (pause, replay, remove, clear) and the giveaway command (start/end/reroll) to harden player-state transitions, validation chains, and permission gates (voice/DJ, ManageGuild).
Covers duration parsing with a 14-day cap, 1-based queue index handling, empty-queue cases, winner selection and announcements, message ID updates and DB cleanup, logging (including guild IDs), and consistent ephemeral error replies.
Summary by CodeRabbit
- Tests
- Added comprehensive automated coverage for giveaway workflows, including starting, ending, rerolling, validation, error handling, and winner announcements.
- Added coverage for music queue commands: clearing tracks, pausing and resuming playback, removing tracks, and replaying songs.
- Verified validation failures, empty queues, invalid inputs, successful responses, permissions, logging, and ephemeral error replies.