test: 覆盖新镜头模型返回旧 Plan 内容的拒绝逻辑
This commit is contained in:
1 parent
e7ba2fb40f
commit
75d0a33e93
1 file changed
+24
@@ -291,6 +291,30 @@ describe('storyboard workflow quality gate recovery', () => {
|
||||
expect(storyboardPersistenceService.replaceByProjectId).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('模型返回相同 Episode 编号但旧 Plan 内容时拒绝保存进度', async () => {
|
||||
const old = structuredClone(episode)
|
||||
const updatedPlan = structuredClone(episode.episodePlan)
|
||||
updatedPlan.storyGoal = '新的剧情目标'
|
||||
vi.mocked(storyboardShotService.generate).mockResolvedValue({ episodeShot: old } as never)
|
||||
await expect(
|
||||
generateStoryboardShotsFromState(
|
||||
state({
|
||||
storyboardPlans: [updatedPlan],
|
||||
storyboardEpisodeShots: [],
|
||||
storyboardPendingQualityEpisodeNos: []
|
||||
})
|
||||
)
|
||||
).rejects.toThrow('Plan 不一致')
|
||||
expect(breakdownCheckpointService.saveStage).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
nodeName: 'storyboard_shots_progress',
|
||||
patch: expect.objectContaining({ storyboardEpisodeShots: [] }),
|
||||
metadata: expect.objectContaining({ failedEpisodeNos: [1] })
|
||||
})
|
||||
)
|
||||
expect(storyboardPersistenceService.replaceByProjectId).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('新 Episode 的 Beat 时长不足时不持久化,并保存失败进度', async () => {
|
||||
const generated = structuredClone(episode)
|
||||
generated.beatShots[0]!.shots[0]!.durationSeconds = 3
|
||||
|
||||
Reference in new issue
Block a user