mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-19 05:16:27 -07:00
feat(stats): separate YouTube channels in the Library
- Store YouTube channels as a distinct media kind and migrate legacy entries safely - Add All Titles, Anime, and YouTube filters with channel-specific stats views
This commit is contained in:
@@ -6,6 +6,7 @@ import { confirmAnimeDelete, setDeleteConfirmPresenter } from '../../lib/delete-
|
||||
import type { AnimeDetailData } from '../../types/stats';
|
||||
|
||||
const DETAIL: AnimeDetailData['detail'] = {
|
||||
mediaKind: 'anime',
|
||||
animeId: 3,
|
||||
canonicalTitle: 'Project Radio Noise Season 2',
|
||||
anilistId: 20661,
|
||||
@@ -69,3 +70,16 @@ test('confirmAnimeDelete spells out how much data the entry deletion removes', a
|
||||
assert.match(seen[1] ?? '', /3 episodes/);
|
||||
assert.match(seen[0] ?? '', /every session and stat/);
|
||||
});
|
||||
|
||||
test('YouTube channel headers show videos and omit all AniList controls', () => {
|
||||
const markup = renderToStaticMarkup(
|
||||
<AnimeHeader
|
||||
detail={{ ...DETAIL, mediaKind: 'youtube' }}
|
||||
anilistEntries={[{ anilistId: 20661, titleRomaji: null, titleEnglish: null, season: null }]}
|
||||
onChangeAnilist={() => {}}
|
||||
/>,
|
||||
);
|
||||
assert.match(markup, /YouTube channel/);
|
||||
assert.match(markup, /video/);
|
||||
assert.doesNotMatch(markup, /AniList|anilist\.co|episode/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user