feat(library): rating line, manga finish-flip notify, game links, dedupe
- render **Rating:** line in manga/book/game/comic body (after read/play status, gated on rating != '0' + stars non-empty), matching watchlist's render.ts convention - manga finish-flip now notifies user (final chapters out), matching chapter-flip's existing notify path - game renderGame emits ## Links (Steam by appid, RAWG by url) — fixes latent owned-heading strip where user-added Links sections silently vanished since games never re-rendered the heading - move duplicated deriveReadStatus/deriveRating/parseNumOrNull into library/convert.ts, import across specs; zero behavior change
This commit is contained in:
parent
d2a6940270
commit
c14da19c47
13 changed files with 140 additions and 83 deletions
|
|
@ -149,6 +149,15 @@ describe('renderBook golden', () => {
|
|||
expect(out).toContain('## My Notes\n\nreread every few years');
|
||||
});
|
||||
|
||||
test('rating line present when rating set', () => {
|
||||
expect(renderBook(RECORD, '')).toContain('**Rating:** ⭐️⭐️⭐️⭐️⭐️ (5/5)');
|
||||
});
|
||||
|
||||
test('rating 0 -> Rating line absent', () => {
|
||||
const r = { ...RECORD, rating: '0', ratingStars: '' };
|
||||
expect(renderBook(r, '')).not.toContain('**Rating:**');
|
||||
});
|
||||
|
||||
test('no goodreads url -> Links has only Open Library entry', () => {
|
||||
const out = renderBook(RECORD, '');
|
||||
expect(out).toContain('- [Open Library](https://openlibrary.org/works/OL1168083W)');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue