Add market watch and match hub workflows
这个提交包含在:
@@ -64,6 +64,35 @@ describe("normalizeTrainingPlanResponse", () => {
|
||||
});
|
||||
expect(result.exercises[1]?.category).toBe("脚步移动");
|
||||
});
|
||||
|
||||
it("derives a fallback exercise when a day section has no exercises array", () => {
|
||||
const result = normalizeTrainingPlanResponse({
|
||||
content: JSON.stringify({
|
||||
day_1: {
|
||||
duration_minutes: 35,
|
||||
focus: "基础脚步与启动速度",
|
||||
summary: "围绕启动速度和小碎步调整展开",
|
||||
},
|
||||
}),
|
||||
fallbackTitle: "7天训练计划",
|
||||
});
|
||||
|
||||
expect(result.exercises).toHaveLength(1);
|
||||
expect(result.exercises[0]).toMatchObject({
|
||||
day: 1,
|
||||
name: "基础脚步与启动速度",
|
||||
});
|
||||
});
|
||||
|
||||
it("returns a readable error when no exercises can be derived", () => {
|
||||
expect(() => normalizeTrainingPlanResponse({
|
||||
content: JSON.stringify({
|
||||
title: "空计划",
|
||||
exercises: [],
|
||||
}),
|
||||
fallbackTitle: "fallback",
|
||||
})).toThrow("训练计划结果为空,请重试或缩小训练重点后再生成。");
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeAdjustedPlanResponse", () => {
|
||||
|
||||
在新工单中引用
屏蔽一个用户