fix: use fixed material download label

dev-QQq
chenyuan 3 weeks ago
parent eb798fdc52
commit c0eea647d7

@ -1,7 +1,7 @@
<template>
<el-button class="material-download" :plain="!material?.url" @click="handleDownload">
<el-icon><Download /></el-icon>
{{ material?.name || "案例文档" }}
下载案例资料
</el-button>
</template>

@ -5,6 +5,7 @@ const path = require("node:path");
const root = path.resolve(__dirname, "..");
const page = fs.readFileSync(path.join(root, "src/views/foundation/new-product-survey.vue"), "utf8");
const api = fs.readFileSync(path.join(root, "src/api/studentTrainingAnswer.js"), "utf8");
const materialButton = fs.readFileSync(path.join(root, "src/views/components/TrainingMaterialButton.vue"), "utf8");
assert.match(page, /const STEP_ONE_SELLING_POINTS = \[/, "step one must define its fixed selling-point questions");
assert.ok((page.match(/selling-point-/g) || []).length >= 11, "step one must contain all 11 selling points");
@ -15,5 +16,7 @@ assert.match(page, /checkNewProductSurveyStepOne/, "step one must request server
assert.match(page, /checkResult/, "step one must retain grading feedback");
assert.match(page, /TrainingMaterialButton/, "the existing material download button must remain in place");
assert.match(api, /new-product-survey\/step-1\/check/, "the student API must call the step-one grading endpoint");
assert.match(materialButton, /下载案例资料/, "the download button must use a fixed student-facing label");
assert.doesNotMatch(materialButton, /\{\{ material\?\.name \|\| "案例文档" \}\}/, "the upload file name must not become button text");
console.log("new product survey step-one contract passed");

Loading…
Cancel
Save