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.
25 lines
1.2 KiB
JavaScript
25 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/diagnosis.vue");
|
|
const materialsRoot = path.resolve(
|
|
__dirname,
|
|
"../../dianshang-houduan/src/main/resources/static/file/training-materials/product-diagnosis-iteration"
|
|
);
|
|
|
|
test("产品问题诊断第 1 步提供漏斗计算与可视化资料下载及图片预览", () => {
|
|
const source = fs.readFileSync(sourcePath, "utf8");
|
|
|
|
["23.实训操作说明1.docx", "23.Excel模版1.xlsx", "23.实训操作说明2.docx", "23.Excel模版2.xlsx"].forEach((name) => {
|
|
assert.ok(fs.existsSync(path.join(materialsRoot, name)), `后端应提供 ${name}`);
|
|
});
|
|
assert.match(source, /节点转化率计算/);
|
|
assert.match(source, /全链路转化漏斗可视化/);
|
|
assert.match(source, /:preview-src-list="\[funnelChart\.url\]"/);
|
|
assert.match(source, /诊断异常节点须从上表已填写渠道中选择/);
|
|
assert.match(source, /\/file\/training-materials\/product-diagnosis-iteration\/23\.Excel%E6%A8%A1%E7%89%881\.xlsx/);
|
|
assert.match(source, /\/file\/training-materials\/product-diagnosis-iteration\/23\.Excel%E6%A8%A1%E7%89%882\.xlsx/);
|
|
});
|