feat(short-drama-agent-front): 新增拆解候选与质量修订
This commit is contained in:
1 parent
49ad08a63e
commit
3414cc8232
32 files changed
+2319
-454
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { actionDraft, actionDraftIssue } from '@/features/breakdown/repair'
|
||||
import type { ShotActionDraft } from '@/features/breakdown/repair.types'
|
||||
|
||||
/** 含手部和身体资源证据的真实字段夹具。 */
|
||||
const saved: ShotActionDraft = {
|
||||
requiredActions: [{ id: 'a', description: '扶住栏杆', kind: 'action', mustPerformInShot: true }],
|
||||
durationPlanning: {
|
||||
complexity: 'low',
|
||||
phases: [
|
||||
{
|
||||
action: '站稳',
|
||||
actionIds: ['a'],
|
||||
estimatedSeconds: 2,
|
||||
handOccupancy: [{ actionId: 'a', characterRef: '@人物', hands: 'left' }],
|
||||
resourceOccupancy: [
|
||||
{ actionId: 'a', ownerRef: '@人物', resource: 'left_hand', usage: 'hold', shareable: false }
|
||||
]
|
||||
}
|
||||
],
|
||||
transitionSeconds: 0,
|
||||
recommendedDurationSeconds: 2,
|
||||
reason: '保持稳定'
|
||||
}
|
||||
}
|
||||
describe('镜头动作修订草稿', () => {
|
||||
it('完整保留证据且编辑草稿不污染源镜头', () => {
|
||||
const draft = actionDraft(saved)
|
||||
draft.durationPlanning.phases[0]!.resourceOccupancy![0]!.usage = 'support'
|
||||
expect(saved.durationPlanning.phases[0]!.resourceOccupancy![0]!.usage).toBe('hold')
|
||||
expect(draft.durationPlanning.phases[0]!.handOccupancy).toEqual(saved.durationPlanning.phases[0]!.handOccupancy)
|
||||
expect(actionDraftIssue(draft)).toBe('')
|
||||
})
|
||||
it('拒绝失效的动作引用、重复编号和无效阶段时长', () => {
|
||||
const draft = actionDraft(saved)
|
||||
draft.requiredActions[0]!.id = 'changed'
|
||||
expect(actionDraftIssue(draft)).toContain('引用')
|
||||
draft.requiredActions.push({ ...draft.requiredActions[0]! })
|
||||
expect(actionDraftIssue(draft)).toContain('编号')
|
||||
draft.requiredActions = [{ ...saved.requiredActions[0]! }]
|
||||
draft.durationPlanning.phases[0]!.estimatedSeconds = 0
|
||||
expect(actionDraftIssue(draft)).toContain('时长')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user