const assert = require("node:assert/strict"); const fs = require("node:fs"); const path = require("node:path"); const test = require("node:test"); const sourcePath = path.resolve(__dirname, "../src/views/assessment/diagnosis.vue"); const materialsRoot = path.resolve( __dirname, "../../dianshang-houduan/src/main/resources/static/file/training-materials/product-diagnosis-iteration" ); test("产品问题诊断第 3 步提供 AB 测试资料下载与对比图预览", () => { const source = fs.readFileSync(sourcePath, "utf8"); ["23.实训操作说明3.docx", "23.Excel模版3.xlsx"].forEach((name) => { assert.ok(fs.existsSync(path.join(materialsRoot, name)), `后端应提供 ${name}`); }); assert.match(source, /找到根因后,还需验证“改进方案是否真的有效”/); assert.match(source, /AB测试数据填报/); assert.match(source, /下载实训操作说明/); assert.match(source, /下载Excel模板/); assert.match(source, /:preview-src-list="\[abChart\.url\]"/); assert.match(source, /23\.Excel%E6%A8%A1%E7%89%883\.xlsx/); });