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/teacher-import-template.sta...

23 lines
965 B
JavaScript

const assert = require("assert");
const fs = require("fs");
const path = require("path");
const page = fs.readFileSync(
path.resolve(__dirname, "../src/views/teacherEnd/teacher/index.vue"),
"utf8"
);
assert(/const downloadTemplate = async \(\) =>/.test(page));
assert(/await import\("xlsx"\)/.test(page));
// 2026-10-12 起新增教师不再采集院校/院系/专业,归属直接继承当前操作用户,模板同步移除对应列
assert(/\["教师姓名", "工号", "电话", "邮箱"\]/.test(page));
assert(!/院校名称/.test(page));
assert(!/院系名称/.test(page));
assert(!/专业名称/.test(page));
assert(/XLSX\.utils\.book_append_sheet\(workbook, templateSheet, "教师导入模板"\)/.test(page));
assert(/XLSX\.writeFile\(workbook, "教师账号导入模板\.xlsx"\)/.test(page));
assert(!/\/file\/教师信息表格\.xlsx/.test(page));
assert(!/a\.href\s*=/.test(page));
console.log("teacher import template download contract passed");