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/category-optimization-step3...

23 lines
1.2 KiB
JavaScript

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/optimization.vue");
const materialsRoot = path.resolve(
__dirname,
"../../dianshang-houduan/src/main/resources/static/file/training-materials/category-optimization"
);
test("品类结构优化第 3 步提供帕累托图资料下载并保留图片预览", () => {
const source = fs.readFileSync(sourcePath, "utf8");
assert.ok(fs.existsSync(path.join(materialsRoot, "20.实训操作说明.docx")), "后端应提供实训操作说明");
assert.ok(fs.existsSync(path.join(materialsRoot, "20.帕累托绘制自动化模版.xlsx")), "后端应提供帕累托图 Excel 模板");
assert.match(source, /下载实训操作说明/);
assert.match(source, /下载 Excel 模板/);
assert.match(source, /:preview-src-list="\[paretoImage\.url\]"/);
assert.match(source, /\/file\/training-materials\/category-optimization\/20\.实训操作说明\.docx/);
assert.match(source, /\/file\/training-materials\/category-optimization\/20\.帕累托绘制自动化模版\.xlsx/);
});