From 597a3f7ceeb2915a99e1dc2e5745e90fc77ea525 Mon Sep 17 00:00:00 2001 From: senke Date: Wed, 25 Mar 2026 23:34:42 +0100 Subject: [PATCH] test: fix and improve unit tests across multiple features Fix mocking issues, add missing test cases, and align tests with current component APIs for analytics, chat, marketplace, player, playlists, settings, tracks, and auth features. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/web/src/components/ui/dropdown.test.tsx | 14 +++++----- .../analytics-page/AnalyticsView.test.tsx | 19 ++++++++++++- .../auth/components/AuthLayout.test.tsx | 4 +-- .../chat/components/ChatInput.test.tsx | 20 +++++++++++-- .../chat/components/ChatMessage.test.tsx | 8 ++++-- .../marketplace/components/Cart.test.tsx | 19 +++++++++---- .../player/components/PlayerError.test.tsx | 4 ++- .../components/QualitySelector.test.tsx | 2 +- .../player/services/playerService.test.ts | 12 ++++---- .../components/PlaylistCard.test.tsx | 8 +++--- .../components/PlaylistErrorBoundary.test.tsx | 4 +-- .../settings/pages/SettingsPage.test.tsx | 26 +++++++++++------ .../tracks/components/CommentSection.test.tsx | 2 +- .../tracks/components/LikeButton.test.tsx | 12 ++++---- .../tracks/components/TrackCard.test.tsx | 16 +++++------ .../tracks/components/TrackSearch.test.tsx | 2 +- .../components/TrackSearchResults.test.tsx | 28 ++++++++++++------- .../tracks/services/commentService.test.ts | 2 +- apps/web/src/services/2fa-service.test.ts | 2 +- 19 files changed, 133 insertions(+), 71 deletions(-) diff --git a/apps/web/src/components/ui/dropdown.test.tsx b/apps/web/src/components/ui/dropdown.test.tsx index 42f8639f7..0cf1c21d0 100644 --- a/apps/web/src/components/ui/dropdown.test.tsx +++ b/apps/web/src/components/ui/dropdown.test.tsx @@ -108,8 +108,8 @@ describe('Dropdown Component', () => { , ); - // The trigger is wrapped in a native