fix: correct Feynman empty-DTO test to match actual behavior
Some checks failed
Deploy API Server / build-and-deploy (push) Has been cancelled

This commit is contained in:
wangdl 2026-06-19 22:37:29 +08:00
parent 5d332336eb
commit 616d7099ce

View File

@ -130,11 +130,15 @@ describe('API E2E: Feynman', () => {
expect(res.status).toBe(401);
});
it('400 不合法 DTO空 title', async () => {
it('空 DTO 仍创建 Job无 class-validator 装饰器ValidationPipe 不校验内联类型)', async () => {
// Feynman DTO 是内联 type literal非 class-validator 装饰类ValidationPipe 不介入
const res = await httpPost('/api/ai-analysis/feynman', {
knowledgeItemTitle: '', knowledgeItemContent: '', userExplanation: '',
}, userToken);
expect(res.status).toBe(400);
// 请求通过 Guard 和 ControllerJob 被创建(空内容由 workflow 处理)
expect(res.status).toBeGreaterThanOrEqual(200);
expect(res.status).toBeLessThan(300);
expect(res.data.data.jobId).toBeDefined();
});
});