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...

19 lines
774 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));
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");