feat: show AI and teacher scores on student home
parent
0128953288
commit
796f74f55e
@ -0,0 +1,27 @@
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const test = require("node:test");
|
||||
const assert = require("node:assert/strict");
|
||||
|
||||
const source = fs.readFileSync(path.resolve(__dirname, "../src/views/student/index.vue"), "utf8");
|
||||
|
||||
test("学生首页并列展示 AI 评分和老师评分", () => {
|
||||
assert.match(source, /AI评分/);
|
||||
assert.match(source, /老师评分/);
|
||||
assert.match(source, /report\.value\.teacherScore/);
|
||||
assert.match(source, /formatTeacherScore/);
|
||||
});
|
||||
|
||||
test("学生首页成绩摘要保持单行且不展示当前排名", () => {
|
||||
assert.match(source, /\.score-summary[^}]*flex-wrap:\s*nowrap/);
|
||||
assert.match(source, /\.score-summary[^}]*white-space:\s*nowrap/);
|
||||
assert.doesNotMatch(source, /当前排名/);
|
||||
assert.doesNotMatch(source, /rank-copy/);
|
||||
});
|
||||
|
||||
test("老师未评分时不拼接分数单位", () => {
|
||||
assert.match(source, /const hasTeacherScore = \(value\) => value !== null && value !== undefined && value !== ""/);
|
||||
assert.match(source, /v-if="hasTeacherScore\(teacherScore\)"/);
|
||||
});
|
||||
|
||||
console.log("student home AI and teacher score static checks passed");
|
||||
Loading…
Reference in New Issue