feat: refine UI, improve UX, optimize the analysis pipeline, and add character standing positions

This commit is contained in:
saturn
2026-04-02 17:39:16 +08:00
parent c3e74c228a
commit 9703714b69
153 changed files with 4472 additions and 1088 deletions

View File

@@ -73,4 +73,38 @@ describe('api specific - project create default audio model', () => {
}),
})
})
it('returns an explicit validation error when description exceeds the max length', async () => {
const mod = await import('@/app/api/projects/route')
const req = buildMockRequest({
path: '/api/projects',
method: 'POST',
headers: {
'accept-language': 'zh-CN',
},
body: {
name: 'Test Project',
description: 'a'.repeat(501),
},
})
const res = await mod.POST(req, routeContext)
const body = await res.json() as {
error?: {
code?: string
message?: string
details?: {
field?: string
limit?: number
}
}
}
expect(res.status).toBe(400)
expect(body.error?.code).toBe('INVALID_PARAMS')
expect(body.error?.message).toBe('项目描述不能超过 500 个字符。')
expect(body.error?.details?.field).toBe('description')
expect(body.error?.details?.limit).toBe(500)
expect(prismaMock.project.create).not.toHaveBeenCalled()
})
})