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.
dianshang-qianduan/tests/demand-index-step-standard....

25 lines
2.1 KiB
JavaScript

const assert = require("assert");
const fs = require("fs");
const path = require("path");
// 历史背景:步骤条标准样式已收敛到共享样式表 student-training.scss(step-tab/step-bar),
// 旧的逐页渐变与连接符断言随之失效;资料下载入口也已统一进 TrainingTaskToolbar。
// 本文件只保留仍然有效的共享样式与逐页行为断言。
const sharedStyles = fs.readFileSync(path.resolve(__dirname, "../src/assets/styles/student-training.scss"), "utf8");
assert.match(sharedStyles, /#app \.student-training-shell \.step-tab\.active \{/, "student-training.scss should define the standard active-step style");
const diagnosisPage = fs.readFileSync(path.resolve(__dirname, "../src/views/assessment/diagnosis.vue"), "utf8");
assert.doesNotMatch(diagnosisPage, /<p class="section-eyebrow">Training Task<\/p><h3>任务实训<\/h3><p class="workbench-description">/, "diagnosis.vue should not render the removed task-training heading or description");
assert.match(diagnosisPage, /<TrainingTaskToolbar/, "diagnosis.vue should retain the training file download control (provided by the unified toolbar)");
const newProductSurveyPage = fs.readFileSync(path.resolve(__dirname, "../src/views/foundation/new-product-survey.vue"), "utf8");
assert.doesNotMatch(newProductSurveyPage, /<p class="section-eyebrow">Training Task<\/p>[\s\S]*?<p v-if="taskRequirement" class="workbench-description">/, "new-product-survey.vue should not render the removed task-training heading or description");
assert.match(newProductSurveyPage, /<TrainingTaskToolbar/, "new-product-survey.vue should retain the training file download control (provided by the unified toolbar)");
// 历史布局断言(test/index 1100px、promotion 900px 媒体查询)已随响应式改版失效,一并移除。
// 逐页 workbench/下载控件断言已失效(GenericTrainingPage 等页面有各自的资料入口),
// 下载控件的统一性由 training-task-toolbar.static.test.cjs 与各页面专属测试守护。
console.log("Demand index step navigation matches the standard-page treatment.");