feat(catalog): 卡片下发完整简介不再截断
backend-ci / test (push) Canceled after 0s

This commit is contained in:
jianghaifeng authored and trae-solo-agent committed 2026-10-30 22:53:22 +08:00
1 parent 958de5ef22
commit afd8d00752
2 files changed
+20 -18

No files matched your search

@@ -130,6 +130,25 @@ class AppCatalogServiceTest {
verify(commentService, never()).countByDrama(any());
}
@Test
void should_keep_full_synopsis_on_card_when_text_exceeds_card_length() {
String longSynopsis = "一纸婚约,开启了甜蜜又心动的同居生活。"
+ "真相只有一个,而她亲手揭开迷雾。一场意外替嫁,让她成为冷面总裁的契约新娘。";
Drama drama = new Drama();
drama.setId(1L);
drama.setTitle("第一部");
drama.setSynopsis(longSynopsis);
given(episodeService.firstPlayableByDramas(List.of(1L))).willReturn(Map.of());
given(dramaCategoryService.listBasic()).willReturn(List.of());
given(commentService.countByEpisodes(List.of())).willReturn(Map.of());
List<AppDramaCardVO> cards = catalogService.toCards(List.of(drama));
assertThat(cards).hasSize(1);
assertThat(cards.get(0).getSynopsisLocales())
.containsEntry("zh", longSynopsis);
}
@Test
void should_filter_feed_by_drama_type_and_expose_it_on_card() {
Drama anime = drama(1L, "ANIME");