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.
|
|
|
|
const assert = require("assert");
|
|
|
|
|
const fs = require("fs");
|
|
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
|
|
const root = path.resolve(__dirname, "..");
|
|
|
|
|
const read = (file) => fs.readFileSync(path.join(root, file), "utf8");
|
|
|
|
|
|
|
|
|
|
const routerSource = read("src/router/index.js");
|
|
|
|
|
const sidebarSource = read("src/layout/components/Sidebar/index.vue");
|
|
|
|
|
const apiSource = read("src/api/teacher.js");
|
|
|
|
|
const pageSource = read("src/views/teacherEnd/defaultTask/index.vue");
|
|
|
|
|
|
|
|
|
|
assert.match(routerSource, /requiresManagerTeacher:\s*true/);
|
|
|
|
|
assert.match(sidebarSource, /capability\.requiresManagerTeacher && userStore\.userInfo\.teacherAdmin !== true/);
|
|
|
|
|
assert.match(apiSource, /\/api\/school-default-tasks/);
|
|
|
|
|
assert.match(pageSource, /正在初始化,稍后刷新/);
|
|
|
|
|
assert.match(pageSource, /立即重试/);
|
|
|
|
|
assert.match(pageSource, /:disabled="!isReady"/);
|
|
|
|
|
|
|
|
|
|
console.log("school default task front-end contract passed");
|