fix(short-drama-agent-front): 修复代码格式检查问题
This commit is contained in:
1 parent
81d6a85260
commit
48fce3975f
87 files changed
+5714
-1436
No files matched your search
@@ -4,12 +4,20 @@ import { getOperation, operationErrorText, runOperation } from '@/features/workf
|
||||
|
||||
describe('面向普通用户的系统提示', () => {
|
||||
it('规则版本冲突显示操作指引,保留原始错误码供流程恢复', () => {
|
||||
const cause = new ApiError('QUALITY_POLICY_VERSION_CONFLICT: 质量规则已更新', 409, undefined, 'QUALITY_POLICY_VERSION_CONFLICT')
|
||||
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 details = {
|
||||
issues: [{ message: 'Shot 主体引用缺失:@CH0001' }],
|
||||
debug: { executionId: 'internal-id', sql: 'SELECT secret' }
|
||||
}
|
||||
const error = new ApiError('后端 Storyboard 校验失败', 400, details)
|
||||
const text = errorMessage(error)
|
||||
expect(text).toContain('分镜')
|
||||
@@ -24,7 +32,9 @@ describe('面向普通用户的系统提示', () => {
|
||||
})
|
||||
it('中文展示不改变恢复流程读取的原始错误,手动更新后的提示也不会沿用旧原因', async () => {
|
||||
const original = new ApiError('Shot 缺少 Primary Keyframe', 400)
|
||||
await runOperation('copy-recovery-test', '生成视频描述', async () => { throw original })
|
||||
await runOperation('copy-recovery-test', '生成视频描述', async () => {
|
||||
throw original
|
||||
})
|
||||
const operation = getOperation('copy-recovery-test')
|
||||
expect(operation.error).toContain('首帧')
|
||||
expect(operation.error).not.toContain('Primary Keyframe')
|
||||
@@ -34,8 +44,15 @@ describe('面向普通用户的系统提示', () => {
|
||||
})
|
||||
})
|
||||
|
||||
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)]) {
|
||||
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