You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
986 B
JavaScript
36 lines
986 B
JavaScript
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");
|