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.
17 lines
1.1 KiB
JavaScript
17 lines
1.1 KiB
JavaScript
const assert = require("assert");
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
const root = path.join(__dirname, "..");
|
|
const page = fs.readFileSync(path.join(root, "src", "views", "teacherEnd", "teacher", "index.vue"), "utf8");
|
|
const api = fs.readFileSync(path.join(root, "src", "api", "teacher.js"), "utf8");
|
|
|
|
assert(page.includes("operatorId: currentUserId.value"), "教师列表请求必须携带当前操作人");
|
|
assert(/:disabled="row\.hasCreatedClass"/.test(page), "已建班教师的操作按钮必须禁用");
|
|
assert(page.includes("该教师已创建班级,不允许编辑或删除"), "锁定原因必须向用户说明");
|
|
assert(/if \(!isOrganizationManagementEnabled\.value\) \{\s*return;\s*\}/.test(page), "无组织结构模式编辑时不得查询院系专业");
|
|
assert(/const rules = computed\(\(\) => \(\{[\s\S]*?isOrganizationManagementEnabled/.test(page), "无组织结构模式编辑时不得保留院系专业必填校验");
|
|
assert(api.includes('url: "/api/user/selectTeacher"'), "教师列表 API 声明必须保留");
|
|
|
|
console.log("teacher management class lock static checks passed");
|