Show alt titles in search results

This commit is contained in:
Dymas
2026-06-02 13:03:22 +02:00
parent 94740ebb76
commit 18d82a8678
6 changed files with 64 additions and 4 deletions
+22
View File
@@ -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)