feat(short-drama-agent-front): 接入人工动作修订与视频版本权限

This commit is contained in:
GJ committed 2026-10-14 13:44:02 +08:00
1 parent 7a60db3ced
commit fa76165960
38 files changed
+2003 -158

No files matched your search

+19 -1
View File
@@ -1,3 +1,4 @@
import { ApiError } from '@/lib/http'
import { defineComponent, reactive, ref } from 'vue'
import { flushPromises, mount, type VueWrapper } from '@vue/test-utils'
import { afterEach, describe, expect, it, vi } from 'vitest'
@@ -542,11 +543,27 @@ describe('质量面板渐进展示', () => {
})
describe('视频修复候选与复检晋升', () => {
it('只允许校验未通过的视频创建一个候选,不自动再次校验', async () => {
it('视频修复遇到同步版本冲突后撤销本会话旧资格并刷新', async () => {
const data = setup({ kind: 'video', shotId: 'shot-1', assetId: 'video-1', title: '视频' })
data.video.canRepair = true
data.validation.passed = false
await data.service.run('validate', input())
expect(sessionVideoValidation(data.projectId, 'shot-1', 'video-1')?.passed).toBe(false)
vi.spyOn(qualityApi, 'repairVideo').mockRejectedValueOnce(
new ApiError('动作版本已过期', 409, { currentMotionPlanRevisionId: 'r2' }, 'MOTION_PLAN_STALE')
)
await data.service.run('repair', input({ maxRepairAttempts: 2 }))
expect(sessionVideoValidation(data.projectId, 'shot-1', 'video-1')).toBeNull()
expect(data.service.session.value.error).toContain('动作版本已过期')
expect(qualityApi.repairVideo).toHaveBeenCalledTimes(1)
})
it('只允许后端授予修复权限的视频创建候选,不自动再次校验', async () => {
const data = setup({ kind: 'video', shotId: 'shot-1', assetId: 'video-1', title: '视频' })
await data.service.run('repair', input({ maxRepairAttempts: 2 }))
expect(data.posts()).toHaveLength(0)
data.validation.passed = false
data.video.canRepair = true
await data.service.run('validate', input())
data.fetcher.mockClear()
await data.service.run('repair', input({ maxRepairAttempts: 2 }))
@@ -562,6 +579,7 @@ describe('视频修复候选与复检晋升', () => {
it('修复不接受零次上限,后端次数限制错误原样保留且不重试', async () => {
const data = setup({ kind: 'video', shotId: 'shot-1', assetId: 'video-1', title: '视频' })
data.validation.passed = false
data.video.canRepair = true
await data.service.run('validate', input())
data.fetcher.mockClear()
await data.service.run('repair', input({ maxRepairAttempts: 0 }))