feat(short-drama-agent-front): 接入人工动作修订与视频版本权限
This commit is contained in:
1 parent
7a60db3ced
commit
fa76165960
38 files changed
+2003
-158
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { videoOperationAllowed } from '@/features/production/video-permissions'
|
||||
import { videoFixture } from '@/features/production/testing/fixtures'
|
||||
|
||||
describe('视频候选操作权限', () => {
|
||||
it('每个候选独立使用后端权限,两个空版本不自行视为过期', () => {
|
||||
const first = videoFixture({ canValidate: false, canRepair: true, canSetPrimary: false })
|
||||
const second = videoFixture({ canValidate: true, canRepair: false, canSetPrimary: true })
|
||||
expect(videoOperationAllowed(first, 'validate')).toBe(false)
|
||||
expect(videoOperationAllowed(first, 'repair')).toBe(true)
|
||||
expect(videoOperationAllowed(second, 'repair')).toBe(false)
|
||||
expect(videoOperationAllowed(second, 'primary')).toBe(true)
|
||||
})
|
||||
it.each(['validate', 'repair', 'primary'] as const)('过期或已终止候选不能执行 %s,即使曾经通过', action => {
|
||||
const permissions = { canValidate: true, canRepair: true, canSetPrimary: true }
|
||||
expect(videoOperationAllowed(videoFixture({ ...permissions, motionPlanStale: true }), action)).toBe(false)
|
||||
expect(
|
||||
videoOperationAllowed(videoFixture({ ...permissions, qualityTerminalStatus: 'stale_motion_plan' }), action)
|
||||
).toBe(false)
|
||||
})
|
||||
it('缺失权限不能当作允许操作', () => expect(videoOperationAllowed({}, 'validate')).toBe(false))
|
||||
})
|
||||
Reference in new issue
Block a user