Collapse watchlist alternative titles
This commit is contained in:
+9
-5
@@ -1746,8 +1746,10 @@ class TemplateHelperTests(unittest.TestCase):
|
||||
self.assertIn("Enter sub or dub", APP.WATCHLIST_HTML)
|
||||
|
||||
def test_watchlist_page_shows_alternative_titles(self):
|
||||
self.assertIn('class="alt-title"', APP.WATCHLIST_HTML)
|
||||
self.assertIn('Alt: ${item.display_alt_titles.join(" · ")}', APP.WATCHLIST_HTML)
|
||||
self.assertIn('class="ghost alt-toggle"', APP.WATCHLIST_HTML)
|
||||
self.assertIn('class="alt-titles"', APP.WATCHLIST_HTML)
|
||||
self.assertIn('Alternative titles', APP.WATCHLIST_HTML)
|
||||
self.assertIn('altTitlesNode.classList.toggle("visible")', APP.WATCHLIST_HTML)
|
||||
|
||||
def test_watchlist_thumbnail_warmup_skips_repeated_attempts(self):
|
||||
self.assertIn("thumbnailWarmupPending: new Set()", APP.WATCHLIST_HTML)
|
||||
@@ -1757,9 +1759,11 @@ class TemplateHelperTests(unittest.TestCase):
|
||||
|
||||
def test_parse_allmanga_alternative_titles_extracts_english_and_synonyms(self):
|
||||
html_text = """
|
||||
<script>
|
||||
{"englishTitle":"Example Show English","synonyms":["Sample Alias","Example Show"]}
|
||||
</script>
|
||||
<div class="show-more-content card-text p-0" style="">
|
||||
<span class="mr-1 altnames"> ⚪ Example Show English </span>
|
||||
<span class="mr-1 altnames"> ⚪ Sample Alias </span>
|
||||
<span class="mr-1 altnames"> ⚪ Example Show </span>
|
||||
</div>
|
||||
"""
|
||||
parsed = APP.parse_allmanga_alternative_titles(html_text, primary_title="Example Show")
|
||||
self.assertEqual(parsed["english_title"], "Example Show English")
|
||||
|
||||
Reference in New Issue
Block a user