release: opensource snapshot 2026-02-27 19:25:00

This commit is contained in:
saturn
2026-02-27 19:25:00 +08:00
commit 5de9622c8b
1055 changed files with 164772 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { describe, expect, it } from 'vitest'
import { resolveSelectedEpisodeId } from '@/app/[locale]/workspace/[projectId]/episode-selection'
describe('resolveSelectedEpisodeId', () => {
it('returns null when episodes list is empty', () => {
expect(resolveSelectedEpisodeId([], null)).toBeNull()
expect(resolveSelectedEpisodeId([], 'ep-1')).toBeNull()
})
it('uses url episode id when it exists in list', () => {
const episodes = [{ id: 'ep-1' }, { id: 'ep-2' }]
expect(resolveSelectedEpisodeId(episodes, 'ep-2')).toBe('ep-2')
})
it('falls back to first episode when url episode id is missing', () => {
const episodes = [{ id: 'ep-1' }, { id: 'ep-2' }]
expect(resolveSelectedEpisodeId(episodes, null)).toBe('ep-1')
})
it('falls back to first episode when url episode id is invalid', () => {
const episodes = [{ id: 'ep-1' }, { id: 'ep-2' }]
expect(resolveSelectedEpisodeId(episodes, 'ep-404')).toBe('ep-1')
})
})

View File

@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest'
import { hasDownstreamStoryboardData } from '@/app/[locale]/workspace/[projectId]/modes/novel-promotion/hooks/useRebuildConfirm'
describe('hasDownstreamStoryboardData', () => {
it('returns false when storyboard and panel counts are both zero', () => {
expect(hasDownstreamStoryboardData({ storyboardCount: 0, panelCount: 0 })).toBe(false)
})
it('returns true when storyboard count is greater than zero', () => {
expect(hasDownstreamStoryboardData({ storyboardCount: 1, panelCount: 0 })).toBe(true)
})
it('returns true when panel count is greater than zero', () => {
expect(hasDownstreamStoryboardData({ storyboardCount: 0, panelCount: 2 })).toBe(true)
})
})