mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-25 00:11:26 -07:00
feat(stats): improve YouTube media metadata and picker key handling
This commit is contained in:
41
stats/src/components/library/MediaDetailView.test.tsx
Normal file
41
stats/src/components/library/MediaDetailView.test.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { getRelatedCollectionLabel } from './MediaDetailView';
|
||||
|
||||
test('getRelatedCollectionLabel returns View Channel for youtube-backed media', () => {
|
||||
assert.equal(
|
||||
getRelatedCollectionLabel({
|
||||
animeId: 1,
|
||||
canonicalTitle: 'Video',
|
||||
totalSessions: 1,
|
||||
totalActiveMs: 1,
|
||||
totalCards: 0,
|
||||
totalTokensSeen: 0,
|
||||
totalLinesSeen: 0,
|
||||
totalLookupCount: 0,
|
||||
totalLookupHits: 0,
|
||||
totalYomitanLookupCount: 0,
|
||||
channelName: 'Creator',
|
||||
}),
|
||||
'View Channel',
|
||||
);
|
||||
});
|
||||
|
||||
test('getRelatedCollectionLabel returns View Anime for non-youtube media', () => {
|
||||
assert.equal(
|
||||
getRelatedCollectionLabel({
|
||||
animeId: 1,
|
||||
canonicalTitle: 'Episode 5',
|
||||
totalSessions: 1,
|
||||
totalActiveMs: 1,
|
||||
totalCards: 0,
|
||||
totalTokensSeen: 0,
|
||||
totalLinesSeen: 0,
|
||||
totalLookupCount: 0,
|
||||
totalLookupHits: 0,
|
||||
totalYomitanLookupCount: 0,
|
||||
channelName: null,
|
||||
}),
|
||||
'View Anime',
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user