From 17ea96dcdb47f9a2513dcaff899b88635134e73a Mon Sep 17 00:00:00 2001 From: Psychotoxical <171614930+Psychotoxical@users.noreply.github.com> Date: Tue, 30 Jun 2026 01:08:35 +0200 Subject: [PATCH] test(offline): mock useOfflineBrowseReloadToken submodule in useSongBrowseList The offline move collapsed a single-module mock into a `@/features/offline` barrel mock, which shadowed the real `useOfflineBrowseContext` the test relied on. Mock the reload-token submodule directly so the barrel re-exports the stub while the sibling context hook stays live. --- src/{ => features/artist}/api/subsonicArtists.router.test.ts | 0 src/{ => features/artist}/api/subsonicArtists.ts | 0 .../artists => features/artist/components}/ArtistAvatars.tsx | 0 src/{ => features/artist}/components/ArtistCardLocal.tsx | 0 .../artist/components}/ArtistDetailHero.tsx | 0 .../artist/components}/ArtistDetailSimilarArtists.tsx | 0 .../artist/components}/ArtistDetailTopTracks.tsx | 0 src/{ => features/artist}/components/ArtistRow.tsx | 0 .../artist/components}/ArtistTopTrackCover.tsx | 0 .../artist/components}/ArtistsGridView.tsx | 0 .../artist/components}/ArtistsListView.tsx | 0 src/{ => features/artist}/components/OpenArtistRefInline.tsx | 0 .../artist/components}/topSongAlbumForCover.test.ts | 0 .../artist/components}/topSongAlbumForCover.ts | 0 src/{ => features/artist}/hooks/useArtistDetailData.test.ts | 0 src/{ => features/artist}/hooks/useArtistDetailData.ts | 0 src/{ => features/artist}/hooks/useArtistInfoBatch.ts | 0 .../artist}/hooks/useArtistOfflineState.test.ts | 0 src/{ => features/artist}/hooks/useArtistOfflineState.ts | 0 src/{ => features/artist}/hooks/useArtistSimilarArtists.ts | 0 src/{ => features/artist}/hooks/useArtistsBrowseCatalog.ts | 0 src/{ => features/artist}/hooks/useArtistsBrowseFilters.ts | 0 .../artist}/hooks/useArtistsBrowseScrollReset.ts | 0 .../artist}/hooks/useArtistsBrowseScrollRestore.ts | 0 src/{ => features/artist}/hooks/useArtistsFiltering.ts | 0 src/{ => features/artist}/hooks/useArtistsInfiniteScroll.ts | 0 src/{ => features/artist}/hooks/useBrowseArtistTextSearch.ts | 0 src/{ => features/artist}/hooks/useNavigateToArtist.ts | 0 src/{ => features/artist}/pages/ArtistDetail.tsx | 0 src/{ => features/artist}/pages/Artists.tsx | 0 .../artist}/store/artistAlbumYearSortStore.test.ts | 0 src/{ => features/artist}/store/artistAlbumYearSortStore.ts | 0 .../artist}/store/artistBrowseSessionStore.test.ts | 0 src/{ => features/artist}/store/artistBrowseSessionStore.ts | 0 src/{ => features/artist}/store/artistLayoutStore.ts | 0 .../artist/utils}/artistsHelpers.test.ts | 0 .../artist/utils}/artistsHelpers.ts | 0 src/{ => features/artist}/utils/openArtistRefs.test.ts | 0 src/{ => features/artist}/utils/openArtistRefs.ts | 0 .../artist/utils}/runArtistDetailActions.ts | 0 .../artist/utils}/runArtistDetailPlay.test.ts | 0 .../artist/utils}/runArtistDetailPlay.ts | 0 .../artist/utils}/sortArtistAlbums.test.ts | 0 .../library => features/artist/utils}/sortArtistAlbums.ts | 0 src/hooks/useSongBrowseList.test.ts | 5 ++++- 45 files changed, 4 insertions(+), 1 deletion(-) rename src/{ => features/artist}/api/subsonicArtists.router.test.ts (100%) rename src/{ => features/artist}/api/subsonicArtists.ts (100%) rename src/{components/artists => features/artist/components}/ArtistAvatars.tsx (100%) rename src/{ => features/artist}/components/ArtistCardLocal.tsx (100%) rename src/{components/artistDetail => features/artist/components}/ArtistDetailHero.tsx (100%) rename src/{components/artistDetail => features/artist/components}/ArtistDetailSimilarArtists.tsx (100%) rename src/{components/artistDetail => features/artist/components}/ArtistDetailTopTracks.tsx (100%) rename src/{ => features/artist}/components/ArtistRow.tsx (100%) rename src/{components/artistDetail => features/artist/components}/ArtistTopTrackCover.tsx (100%) rename src/{components/artists => features/artist/components}/ArtistsGridView.tsx (100%) rename src/{components/artists => features/artist/components}/ArtistsListView.tsx (100%) rename src/{ => features/artist}/components/OpenArtistRefInline.tsx (100%) rename src/{components/artistDetail => features/artist/components}/topSongAlbumForCover.test.ts (100%) rename src/{components/artistDetail => features/artist/components}/topSongAlbumForCover.ts (100%) rename src/{ => features/artist}/hooks/useArtistDetailData.test.ts (100%) rename src/{ => features/artist}/hooks/useArtistDetailData.ts (100%) rename src/{ => features/artist}/hooks/useArtistInfoBatch.ts (100%) rename src/{ => features/artist}/hooks/useArtistOfflineState.test.ts (100%) rename src/{ => features/artist}/hooks/useArtistOfflineState.ts (100%) rename src/{ => features/artist}/hooks/useArtistSimilarArtists.ts (100%) rename src/{ => features/artist}/hooks/useArtistsBrowseCatalog.ts (100%) rename src/{ => features/artist}/hooks/useArtistsBrowseFilters.ts (100%) rename src/{ => features/artist}/hooks/useArtistsBrowseScrollReset.ts (100%) rename src/{ => features/artist}/hooks/useArtistsBrowseScrollRestore.ts (100%) rename src/{ => features/artist}/hooks/useArtistsFiltering.ts (100%) rename src/{ => features/artist}/hooks/useArtistsInfiniteScroll.ts (100%) rename src/{ => features/artist}/hooks/useBrowseArtistTextSearch.ts (100%) rename src/{ => features/artist}/hooks/useNavigateToArtist.ts (100%) rename src/{ => features/artist}/pages/ArtistDetail.tsx (100%) rename src/{ => features/artist}/pages/Artists.tsx (100%) rename src/{ => features/artist}/store/artistAlbumYearSortStore.test.ts (100%) rename src/{ => features/artist}/store/artistAlbumYearSortStore.ts (100%) rename src/{ => features/artist}/store/artistBrowseSessionStore.test.ts (100%) rename src/{ => features/artist}/store/artistBrowseSessionStore.ts (100%) rename src/{ => features/artist}/store/artistLayoutStore.ts (100%) rename src/{utils/componentHelpers => features/artist/utils}/artistsHelpers.test.ts (100%) rename src/{utils/componentHelpers => features/artist/utils}/artistsHelpers.ts (100%) rename src/{ => features/artist}/utils/openArtistRefs.test.ts (100%) rename src/{ => features/artist}/utils/openArtistRefs.ts (100%) rename src/{utils/componentHelpers => features/artist/utils}/runArtistDetailActions.ts (100%) rename src/{utils/componentHelpers => features/artist/utils}/runArtistDetailPlay.test.ts (100%) rename src/{utils/componentHelpers => features/artist/utils}/runArtistDetailPlay.ts (100%) rename src/{utils/library => features/artist/utils}/sortArtistAlbums.test.ts (100%) rename src/{utils/library => features/artist/utils}/sortArtistAlbums.ts (100%) diff --git a/src/api/subsonicArtists.router.test.ts b/src/features/artist/api/subsonicArtists.router.test.ts similarity index 100% rename from src/api/subsonicArtists.router.test.ts rename to src/features/artist/api/subsonicArtists.router.test.ts diff --git a/src/api/subsonicArtists.ts b/src/features/artist/api/subsonicArtists.ts similarity index 100% rename from src/api/subsonicArtists.ts rename to src/features/artist/api/subsonicArtists.ts diff --git a/src/components/artists/ArtistAvatars.tsx b/src/features/artist/components/ArtistAvatars.tsx similarity index 100% rename from src/components/artists/ArtistAvatars.tsx rename to src/features/artist/components/ArtistAvatars.tsx diff --git a/src/components/ArtistCardLocal.tsx b/src/features/artist/components/ArtistCardLocal.tsx similarity index 100% rename from src/components/ArtistCardLocal.tsx rename to src/features/artist/components/ArtistCardLocal.tsx diff --git a/src/components/artistDetail/ArtistDetailHero.tsx b/src/features/artist/components/ArtistDetailHero.tsx similarity index 100% rename from src/components/artistDetail/ArtistDetailHero.tsx rename to src/features/artist/components/ArtistDetailHero.tsx diff --git a/src/components/artistDetail/ArtistDetailSimilarArtists.tsx b/src/features/artist/components/ArtistDetailSimilarArtists.tsx similarity index 100% rename from src/components/artistDetail/ArtistDetailSimilarArtists.tsx rename to src/features/artist/components/ArtistDetailSimilarArtists.tsx diff --git a/src/components/artistDetail/ArtistDetailTopTracks.tsx b/src/features/artist/components/ArtistDetailTopTracks.tsx similarity index 100% rename from src/components/artistDetail/ArtistDetailTopTracks.tsx rename to src/features/artist/components/ArtistDetailTopTracks.tsx diff --git a/src/components/ArtistRow.tsx b/src/features/artist/components/ArtistRow.tsx similarity index 100% rename from src/components/ArtistRow.tsx rename to src/features/artist/components/ArtistRow.tsx diff --git a/src/components/artistDetail/ArtistTopTrackCover.tsx b/src/features/artist/components/ArtistTopTrackCover.tsx similarity index 100% rename from src/components/artistDetail/ArtistTopTrackCover.tsx rename to src/features/artist/components/ArtistTopTrackCover.tsx diff --git a/src/components/artists/ArtistsGridView.tsx b/src/features/artist/components/ArtistsGridView.tsx similarity index 100% rename from src/components/artists/ArtistsGridView.tsx rename to src/features/artist/components/ArtistsGridView.tsx diff --git a/src/components/artists/ArtistsListView.tsx b/src/features/artist/components/ArtistsListView.tsx similarity index 100% rename from src/components/artists/ArtistsListView.tsx rename to src/features/artist/components/ArtistsListView.tsx diff --git a/src/components/OpenArtistRefInline.tsx b/src/features/artist/components/OpenArtistRefInline.tsx similarity index 100% rename from src/components/OpenArtistRefInline.tsx rename to src/features/artist/components/OpenArtistRefInline.tsx diff --git a/src/components/artistDetail/topSongAlbumForCover.test.ts b/src/features/artist/components/topSongAlbumForCover.test.ts similarity index 100% rename from src/components/artistDetail/topSongAlbumForCover.test.ts rename to src/features/artist/components/topSongAlbumForCover.test.ts diff --git a/src/components/artistDetail/topSongAlbumForCover.ts b/src/features/artist/components/topSongAlbumForCover.ts similarity index 100% rename from src/components/artistDetail/topSongAlbumForCover.ts rename to src/features/artist/components/topSongAlbumForCover.ts diff --git a/src/hooks/useArtistDetailData.test.ts b/src/features/artist/hooks/useArtistDetailData.test.ts similarity index 100% rename from src/hooks/useArtistDetailData.test.ts rename to src/features/artist/hooks/useArtistDetailData.test.ts diff --git a/src/hooks/useArtistDetailData.ts b/src/features/artist/hooks/useArtistDetailData.ts similarity index 100% rename from src/hooks/useArtistDetailData.ts rename to src/features/artist/hooks/useArtistDetailData.ts diff --git a/src/hooks/useArtistInfoBatch.ts b/src/features/artist/hooks/useArtistInfoBatch.ts similarity index 100% rename from src/hooks/useArtistInfoBatch.ts rename to src/features/artist/hooks/useArtistInfoBatch.ts diff --git a/src/hooks/useArtistOfflineState.test.ts b/src/features/artist/hooks/useArtistOfflineState.test.ts similarity index 100% rename from src/hooks/useArtistOfflineState.test.ts rename to src/features/artist/hooks/useArtistOfflineState.test.ts diff --git a/src/hooks/useArtistOfflineState.ts b/src/features/artist/hooks/useArtistOfflineState.ts similarity index 100% rename from src/hooks/useArtistOfflineState.ts rename to src/features/artist/hooks/useArtistOfflineState.ts diff --git a/src/hooks/useArtistSimilarArtists.ts b/src/features/artist/hooks/useArtistSimilarArtists.ts similarity index 100% rename from src/hooks/useArtistSimilarArtists.ts rename to src/features/artist/hooks/useArtistSimilarArtists.ts diff --git a/src/hooks/useArtistsBrowseCatalog.ts b/src/features/artist/hooks/useArtistsBrowseCatalog.ts similarity index 100% rename from src/hooks/useArtistsBrowseCatalog.ts rename to src/features/artist/hooks/useArtistsBrowseCatalog.ts diff --git a/src/hooks/useArtistsBrowseFilters.ts b/src/features/artist/hooks/useArtistsBrowseFilters.ts similarity index 100% rename from src/hooks/useArtistsBrowseFilters.ts rename to src/features/artist/hooks/useArtistsBrowseFilters.ts diff --git a/src/hooks/useArtistsBrowseScrollReset.ts b/src/features/artist/hooks/useArtistsBrowseScrollReset.ts similarity index 100% rename from src/hooks/useArtistsBrowseScrollReset.ts rename to src/features/artist/hooks/useArtistsBrowseScrollReset.ts diff --git a/src/hooks/useArtistsBrowseScrollRestore.ts b/src/features/artist/hooks/useArtistsBrowseScrollRestore.ts similarity index 100% rename from src/hooks/useArtistsBrowseScrollRestore.ts rename to src/features/artist/hooks/useArtistsBrowseScrollRestore.ts diff --git a/src/hooks/useArtistsFiltering.ts b/src/features/artist/hooks/useArtistsFiltering.ts similarity index 100% rename from src/hooks/useArtistsFiltering.ts rename to src/features/artist/hooks/useArtistsFiltering.ts diff --git a/src/hooks/useArtistsInfiniteScroll.ts b/src/features/artist/hooks/useArtistsInfiniteScroll.ts similarity index 100% rename from src/hooks/useArtistsInfiniteScroll.ts rename to src/features/artist/hooks/useArtistsInfiniteScroll.ts diff --git a/src/hooks/useBrowseArtistTextSearch.ts b/src/features/artist/hooks/useBrowseArtistTextSearch.ts similarity index 100% rename from src/hooks/useBrowseArtistTextSearch.ts rename to src/features/artist/hooks/useBrowseArtistTextSearch.ts diff --git a/src/hooks/useNavigateToArtist.ts b/src/features/artist/hooks/useNavigateToArtist.ts similarity index 100% rename from src/hooks/useNavigateToArtist.ts rename to src/features/artist/hooks/useNavigateToArtist.ts diff --git a/src/pages/ArtistDetail.tsx b/src/features/artist/pages/ArtistDetail.tsx similarity index 100% rename from src/pages/ArtistDetail.tsx rename to src/features/artist/pages/ArtistDetail.tsx diff --git a/src/pages/Artists.tsx b/src/features/artist/pages/Artists.tsx similarity index 100% rename from src/pages/Artists.tsx rename to src/features/artist/pages/Artists.tsx diff --git a/src/store/artistAlbumYearSortStore.test.ts b/src/features/artist/store/artistAlbumYearSortStore.test.ts similarity index 100% rename from src/store/artistAlbumYearSortStore.test.ts rename to src/features/artist/store/artistAlbumYearSortStore.test.ts diff --git a/src/store/artistAlbumYearSortStore.ts b/src/features/artist/store/artistAlbumYearSortStore.ts similarity index 100% rename from src/store/artistAlbumYearSortStore.ts rename to src/features/artist/store/artistAlbumYearSortStore.ts diff --git a/src/store/artistBrowseSessionStore.test.ts b/src/features/artist/store/artistBrowseSessionStore.test.ts similarity index 100% rename from src/store/artistBrowseSessionStore.test.ts rename to src/features/artist/store/artistBrowseSessionStore.test.ts diff --git a/src/store/artistBrowseSessionStore.ts b/src/features/artist/store/artistBrowseSessionStore.ts similarity index 100% rename from src/store/artistBrowseSessionStore.ts rename to src/features/artist/store/artistBrowseSessionStore.ts diff --git a/src/store/artistLayoutStore.ts b/src/features/artist/store/artistLayoutStore.ts similarity index 100% rename from src/store/artistLayoutStore.ts rename to src/features/artist/store/artistLayoutStore.ts diff --git a/src/utils/componentHelpers/artistsHelpers.test.ts b/src/features/artist/utils/artistsHelpers.test.ts similarity index 100% rename from src/utils/componentHelpers/artistsHelpers.test.ts rename to src/features/artist/utils/artistsHelpers.test.ts diff --git a/src/utils/componentHelpers/artistsHelpers.ts b/src/features/artist/utils/artistsHelpers.ts similarity index 100% rename from src/utils/componentHelpers/artistsHelpers.ts rename to src/features/artist/utils/artistsHelpers.ts diff --git a/src/utils/openArtistRefs.test.ts b/src/features/artist/utils/openArtistRefs.test.ts similarity index 100% rename from src/utils/openArtistRefs.test.ts rename to src/features/artist/utils/openArtistRefs.test.ts diff --git a/src/utils/openArtistRefs.ts b/src/features/artist/utils/openArtistRefs.ts similarity index 100% rename from src/utils/openArtistRefs.ts rename to src/features/artist/utils/openArtistRefs.ts diff --git a/src/utils/componentHelpers/runArtistDetailActions.ts b/src/features/artist/utils/runArtistDetailActions.ts similarity index 100% rename from src/utils/componentHelpers/runArtistDetailActions.ts rename to src/features/artist/utils/runArtistDetailActions.ts diff --git a/src/utils/componentHelpers/runArtistDetailPlay.test.ts b/src/features/artist/utils/runArtistDetailPlay.test.ts similarity index 100% rename from src/utils/componentHelpers/runArtistDetailPlay.test.ts rename to src/features/artist/utils/runArtistDetailPlay.test.ts diff --git a/src/utils/componentHelpers/runArtistDetailPlay.ts b/src/features/artist/utils/runArtistDetailPlay.ts similarity index 100% rename from src/utils/componentHelpers/runArtistDetailPlay.ts rename to src/features/artist/utils/runArtistDetailPlay.ts diff --git a/src/utils/library/sortArtistAlbums.test.ts b/src/features/artist/utils/sortArtistAlbums.test.ts similarity index 100% rename from src/utils/library/sortArtistAlbums.test.ts rename to src/features/artist/utils/sortArtistAlbums.test.ts diff --git a/src/utils/library/sortArtistAlbums.ts b/src/features/artist/utils/sortArtistAlbums.ts similarity index 100% rename from src/utils/library/sortArtistAlbums.ts rename to src/features/artist/utils/sortArtistAlbums.ts diff --git a/src/hooks/useSongBrowseList.test.ts b/src/hooks/useSongBrowseList.test.ts index fa2d61d2..06e62204 100644 --- a/src/hooks/useSongBrowseList.test.ts +++ b/src/hooks/useSongBrowseList.test.ts @@ -18,7 +18,10 @@ vi.mock('../utils/library/advancedSearchLocal', () => ({ runLocalSongBrowse: vi.fn(async () => []), })); -vi.mock('@/features/offline', () => ({ +// Only the reload-token hook was stubbed pre-move (its own module); mock that +// submodule directly so the barrel re-exports the stub while the real +// `useOfflineBrowseContext` (a different submodule) stays live. +vi.mock('@/features/offline/hooks/useOfflineBrowseReloadToken', () => ({ useOfflineBrowseReloadToken: () => undefined, }));