feat(short-drama-agent-front): 完善分镜审核与制作准备流程
This commit is contained in:
1 parent
c4b43b9725
commit
1da56e0d46
72 files changed
+2801
-528
No files matched your search
@@ -3,6 +3,11 @@ import { ApiError, errorMessage } from '@/lib/http'
|
||||
import { getOperation, operationErrorText, runOperation } from '@/features/workflows/operations'
|
||||
|
||||
describe('面向普通用户的系统提示', () => {
|
||||
it('规则版本冲突显示操作指引,保留原始错误码供流程恢复', () => {
|
||||
const cause = new ApiError('QUALITY_POLICY_VERSION_CONFLICT: 质量规则已更新', 409, undefined, 'QUALITY_POLICY_VERSION_CONFLICT')
|
||||
expect(errorMessage(cause)).not.toContain('QUALITY_POLICY_VERSION_CONFLICT')
|
||||
expect(cause.code).toBe('QUALITY_POLICY_VERSION_CONFLICT')
|
||||
})
|
||||
it('错误展示使用中文说明,不把技术字段和调试对象直接输出给用户', () => {
|
||||
const details = { issues: [{ message: 'Shot 主体引用缺失:@CH0001' }], debug: { executionId: 'internal-id', sql: 'SELECT secret' } }
|
||||
const error = new ApiError('后端 Storyboard 校验失败', 400, details)
|
||||
@@ -28,3 +33,11 @@ describe('面向普通用户的系统提示', () => {
|
||||
expect(operationErrorText(operation)).toBe('新的操作原因')
|
||||
})
|
||||
})
|
||||
|
||||
it.each(['CANVAS_CHANGE_REQUIRES_REVALIDATION', 'CREATIVE_PROFILE_ACTIVE_WORKFLOW', 'GENERATION_CONFIG_CHANGE_REQUIRES_REVALIDATION'])('配置冲突 %s 从真实 details.code 或顶层 code 转成中文原因', code => {
|
||||
for (const cause of [new ApiError('请求失败(409)', 409, { code }), new ApiError('服务器内部错误', 409, undefined, code)]) {
|
||||
expect(errorMessage(cause)).not.toMatch(/请求失败|服务器内部错误|REQUIRES|WORKFLOW/)
|
||||
expect(errorMessage(cause)).toMatch(/画幅|任务|模型/)
|
||||
expect(cause.status).toBe(409)
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user