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.
20 lines
784 B
JavaScript
20 lines
784 B
JavaScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
|
|
const root = resolve(import.meta.dirname, "..");
|
|
const page = readFileSync(resolve(root, "src/views/teacherEnd/student/index.vue"), "utf8");
|
|
|
|
assert.match(
|
|
page,
|
|
/const ownTeachingClass = teachingClassOptions\.value\.find\(\(schoolClass\) => sameValue\(schoolClass\.createdBy, currentUserId\.value\)\);/,
|
|
"学生管理应识别当前教师本人创建的教学班"
|
|
);
|
|
assert.match(
|
|
page,
|
|
/paramsquery\.value\.schoolClassId = ownTeachingClass\?\.schoolClassId \|\| "";/,
|
|
"首次进入学生管理应默认选中本人创建的班级;不存在时保持未选择"
|
|
);
|
|
|
|
console.log("student management prefers the current teacher's own class by default");
|