import assert from "node:assert/strict"; import { buildStudentTaskSections, getComprehensiveTopTask } from "../src/utils/studentTrainingNavigation.js"; const sections = buildStudentTaskSections([ { taskKey: "teacher-added-task", taskName: "教师新增任务", projectName: "市场洞察与需求分析", sort: 1, }, ]); assert.deepEqual(sections, [ { title: "市场洞察与需求分析", children: [{ title: "教师新增任务", path: "/training/task/teacher-added-task" }], }, ]); assert.deepEqual(buildStudentTaskSections([ { taskKey: "comprehensive-case-training", taskName: "综合案例实训", projectName: "综合实训", sort: 99, }, ]), []); assert.deepEqual(getComprehensiveTopTask([{ taskKey: "comprehensive-case-training", taskName: "综合实训" }]), { title: "综合实训", path: "/comprehensive/index", activePrefix: "/comprehensive", }); console.log("student training navigation ESM contract passed");