From 965c68405ec52f857dc86f7cdcaf6f2704e0522d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Oct 2026 15:50:25 +0800 Subject: [PATCH] =?UTF-8?q?test(web):=20=E5=89=A7=E9=9B=86=E7=BB=84?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=B5=8B=E8=AF=95=E6=8C=89=20lint=20?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E4=BC=A0=20children?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei --- .../app/components/library/episode-structure.test.ts | 12 +++++++++--- .../web/app/components/library/episode-structure.tsx | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/web/app/components/library/episode-structure.test.ts b/apps/web/app/components/library/episode-structure.test.ts index ff814ad3..268cd437 100644 --- a/apps/web/app/components/library/episode-structure.test.ts +++ b/apps/web/app/components/library/episode-structure.test.ts @@ -10,7 +10,13 @@ import { StructureTrack, SubscriptionSeasonPicker, } from "./episode-structure.tsx"; -import { hasStructureChoice, inLibraryText, originText, seasonLine, structureOptions } from "./episode-structure-model.ts"; +import { + hasStructureChoice, + inLibraryText, + originText, + seasonLine, + structureOptions, +} from "./episode-structure-model.ts"; const ENTITY = "6b1f2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"; @@ -159,7 +165,7 @@ describe("季集结构:组件", () => { withCache(createElement(SubscriptionSeasonPicker, { entityId: ENTITY, value: "", onChange: () => {} }), empty), ).toBe(""); const html = withCache( - createElement(EpisodeStructureSwitcher, { entityId: ENTITY, children: createElement("p", null, "原季列表") }), + createElement(EpisodeStructureSwitcher, { entityId: ENTITY }, createElement("p", null, "原季列表")), empty, ); expect(html).toBe("

原季列表

"); @@ -167,7 +173,7 @@ describe("季集结构:组件", () => { it("作品页:有剧集组时轨道在季列表上方,当前结构显示原来的季与集", () => { const html = withCache( - createElement(EpisodeStructureSwitcher, { entityId: ENTITY, children: createElement("p", null, "原季列表") }), + createElement(EpisodeStructureSwitcher, { entityId: ENTITY }, createElement("p", null, "原季列表")), groups("grp-production"), ); expect(html).toContain("季集结构"); diff --git a/apps/web/app/components/library/episode-structure.tsx b/apps/web/app/components/library/episode-structure.tsx index f27ce556..ef0473cf 100644 --- a/apps/web/app/components/library/episode-structure.tsx +++ b/apps/web/app/components/library/episode-structure.tsx @@ -201,7 +201,7 @@ function resultToast(r: EpisodeGroupSetResult) { * 作品页「季与集」顶部的季集结构切换:只有 TMDB 有剧集组(或作品已选了剧集组)时出现。 * 选中当前结构时显示 children(现有的季与集);选中其它结构时显示该结构的季卡片预览与「改用这套结构」。 */ -export function EpisodeStructureSwitcher({ entityId, children }: { entityId: string; children: ReactNode }) { +export function EpisodeStructureSwitcher({ entityId, children }: { entityId: string; children?: ReactNode }) { const groups = useEpisodeGroups(entityId); const options = structureOptions(groups.data); const current = groups.data?.current?.groupId ?? null;