From c0eea647d70a74240f9e64ebefa83a21d3639e15 Mon Sep 17 00:00:00 2001 From: chenyuan Date: Fri, 7 Aug 2026 11:04:32 +0800 Subject: [PATCH] fix: use fixed material download label --- src/views/components/TrainingMaterialButton.vue | 2 +- tests/new-product-survey-step-one.static.test.cjs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/components/TrainingMaterialButton.vue b/src/views/components/TrainingMaterialButton.vue index 0f38c6a..99b4fb0 100644 --- a/src/views/components/TrainingMaterialButton.vue +++ b/src/views/components/TrainingMaterialButton.vue @@ -1,7 +1,7 @@ diff --git a/tests/new-product-survey-step-one.static.test.cjs b/tests/new-product-survey-step-one.static.test.cjs index afcf99b..b47160e 100644 --- a/tests/new-product-survey-step-one.static.test.cjs +++ b/tests/new-product-survey-step-one.static.test.cjs @@ -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");