mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-01 05:40:50 -07:00
feat(stats): speed up session maintenance and improve stats UI (#111)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { renderToStaticMarkup } from 'react-dom/server';
|
||||
import { AnimeCard } from './AnimeCard';
|
||||
|
||||
test('AnimeCard includes linked AniList id in cover URLs to avoid stale library covers', () => {
|
||||
const markup = renderToStaticMarkup(
|
||||
<AnimeCard
|
||||
anime={{
|
||||
animeId: 42,
|
||||
canonicalTitle: 'Test Anime',
|
||||
anilistId: 21699,
|
||||
totalSessions: 1,
|
||||
totalActiveMs: 600_000,
|
||||
totalCards: 0,
|
||||
totalTokensSeen: 100,
|
||||
episodeCount: 1,
|
||||
episodesTotal: 10,
|
||||
lastWatchedMs: 1_000,
|
||||
}}
|
||||
onClick={() => {}}
|
||||
/>,
|
||||
);
|
||||
|
||||
assert.match(markup, /\/api\/stats\/anime\/42\/cover\?coverRetry=21699/);
|
||||
});
|
||||
Reference in New Issue
Block a user