Show alt titles in search results
This commit is contained in:
+22
@@ -3237,6 +3237,28 @@ class TemplateHelperTests(unittest.TestCase):
|
||||
self.assertIn("Select results", APP.INDEX_HTML)
|
||||
self.assertIn("resultThumbnailUrl(title)", APP.INDEX_HTML)
|
||||
self.assertIn('/api/search/thumb?title=', APP.INDEX_HTML)
|
||||
self.assertIn("result-subtitle", APP.INDEX_HTML)
|
||||
self.assertIn("Also known as:", APP.INDEX_HTML)
|
||||
|
||||
def test_search_anime_includes_alternative_titles(self):
|
||||
payload = {
|
||||
"shows": {
|
||||
"edges": [
|
||||
{
|
||||
"_id": "show-1",
|
||||
"name": "Example Show",
|
||||
"availableEpisodes": {"sub": 12},
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
with mock.patch.object(APP, "graph_request", return_value=payload), mock.patch.object(
|
||||
APP, "extract_anidb_alternative_titles_for_title",
|
||||
return_value=[{"label": "English", "value": "Example Show English"}],
|
||||
):
|
||||
results = APP.search_anime("Example Show", "sub")
|
||||
|
||||
self.assertEqual(results[0]["alternative_titles"], [{"label": "English", "value": "Example Show English"}])
|
||||
|
||||
def test_pages_share_serial_polling_helper(self):
|
||||
self.assertIn("function startSerialPoll(callback, intervalMs)", APP.QUEUE_HTML)
|
||||
|
||||
Reference in New Issue
Block a user