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/product/hardware-cost.vue"); const guidePath = path.resolve( __dirname, "../../dianshang-houduan/src/main/resources/static/file/training-materials/hardware-cost/16.饼图制作操作说明.docx" ); test("硬件成本估算操作指导由后端内置 Word 文件提供下载", () => { const source = fs.readFileSync(sourcePath, "utf8"); assert.ok(fs.existsSync(guidePath), "后端应提供饼图制作操作说明 Word 文件"); assert.match(source, /\/file\/training-materials\/hardware-cost\/16\.饼图制作操作说明\.docx/); assert.match( source, /function downloadCostStructureGuide\(\) \{\s*downloadBuiltInFile\(HARDWARE_COST_GUIDE_URL, "16\.饼图制作操作说明\.docx"\);\s*\}/ ); });