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.
dianshang-qianduan/tests/score-center-class-access-t...

22 lines
1012 B
JavaScript

const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const root = path.resolve(__dirname, "..");
const page = fs.readFileSync(path.join(root, "src/views/teacherEnd/score/index.vue"), "utf8");
const api = fs.readFileSync(path.join(root, "src/api/teacher.js"), "utf8");
assert.match(page, /label="老师评分"/);
assert.match(page, /自动汇总/);
assert.match(page, /canManageSelectedClass/);
assert.match(page, /createdBy/);
assert.match(page, /saveTaskTeacherScore/);
assert.match(page, /教师评分必须为0至100之间的数值/);
assert.match(page, /ownClass \|\| teachingClassList\.value\[0\]/);
assert.match(page, /getAccessibleTeachingClasses/);
assert.doesNotMatch(page, /onMounted\(\(\) => \{\s*getList\(\);\s*getClassList/);
assert.match(api, /url: "\/api\/weight\/saveTaskTeacherScore"/);
assert.match(api, /url: "\/api\/weight\/accessibleTeachingClasses"/);
console.log("score center class access and teacher score contract passed");