From 281e36c6d3094d36e6fcdde8cd0c457788ae68eb Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 20 Aug 2026 08:19:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(media-detail):=20=E5=AD=A3=E9=9B=86?= =?UTF-8?q?=E6=95=B0=E4=B8=BA=200=20=E6=97=B6=E4=B8=8D=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=8A=B6=E6=80=81=E6=A0=87=E7=AD=BE=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E8=AF=AF=E5=AF=BC=E6=80=A7=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=B7=B2=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 剧集详情季列表:当季 episode_count 为 0 时隐藏已入库/缺失状态标签 - 补充回归测试 --- src/views/discover/MediaDetailView.vue | 6 ++++- .../__tests__/MediaDetailView.spec.ts | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/views/discover/MediaDetailView.vue b/src/views/discover/MediaDetailView.vue index bd402c91..3ce99040 100644 --- a/src/views/discover/MediaDetailView.vue +++ b/src/views/discover/MediaDetailView.vue @@ -1083,7 +1083,11 @@ onUnmounted(() => { {{ t('media.episodeCount', { count: season.episode_count }) }}
- + {{ getExistText(season.season_number || 0) }} { }) }) + it('hides the status badge for a season with zero episodes', async () => { + const media = createSubscribeTv({ + season_info: [ + createMediaSeason({ episode_count: 0, season_number: 1 }), + createMediaSeason({ episode_count: 2, season_number: 2 }), + ], + title: '零集数状态剧', + tmdb_id: 8710, + }) + const notExists = [createNotExistMediaInfo({ episodes: [1, 2], season: 2, total_episode: 2 })] + const { container } = await renderDetail({ media, notExists, type: '电视剧' }) + + await waitFor(() => { + const panels = [...container.querySelectorAll('.v-expansion-panel')] + expect(panels).toHaveLength(2) + // 集数为 0 的季不渲染任何存在状态标签 + expect(panels[0].textContent).toMatch(/第 1 季/) + expect(panels[0].textContent).not.toMatch(/已入库|缺失/) + expect(panels[1].textContent).toMatch(/第 2 季.*已入库/s) + }) + }) + it('loads season episodes and marks episodes that already exist remotely', async () => { const media = createSubscribeTv({ season_info: [createMediaSeason({ episode_count: 2, season_number: 1 })],