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/structure.vue"); const templatePath = path.resolve( __dirname, "../../dianshang-houduan/src/main/resources/static/file/training-materials/product-architecture/13.产品架构图绘制模版.pptx" ); test("产品架构图绘制模板由后端内置 PPTX 提供下载", () => { const source = fs.readFileSync(sourcePath, "utf8"); assert.ok(fs.existsSync(templatePath), "后端应提供产品架构图绘制 PPTX 模板"); assert.match( source, /\/file\/training-materials\/product-architecture\/13\.产品架构图绘制模版\.pptx/ ); assert.match( source, /function downloadArchitectureTemplate\(\) \{\s*downloadBuiltInFile\(PRODUCT_ARCHITECTURE_TEMPLATE_URL, "13\.产品架构图绘制模版\.pptx"\);\s*\}/ ); });