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.
21 lines
944 B
JavaScript
21 lines
944 B
JavaScript
|
3 days ago
|
const assert = require("node:assert/strict");
|
||
|
|
const fs = require("node:fs");
|
||
|
|
const path = require("node:path");
|
||
|
|
const test = require("node:test");
|
||
|
|
|
||
|
|
const source = fs.readFileSync(path.resolve(__dirname, "../src/views/demand/consumer-scenario.vue"), "utf8");
|
||
|
|
const templatePath = path.resolve(
|
||
|
|
__dirname,
|
||
|
|
"../../dianshang-houduan/src/main/resources/static/file/training-materials/consumer-scenario/10.用户购买旅程模版.pptx"
|
||
|
|
);
|
||
|
|
|
||
|
|
test("用户购买旅程模板从后端内置资料目录下载", () => {
|
||
|
|
assert.ok(fs.existsSync(templatePath), "用户购买旅程模板应随后端资源发布");
|
||
|
|
assert.match(source, /\/file\/training-materials\/consumer-scenario\/10\.用户购买旅程模版\.pptx/);
|
||
|
|
assert.match(
|
||
|
|
source,
|
||
|
|
/function downloadJourneyMapTemplate\(\) \{\s*downloadBuiltInFile\(JOURNEY_TEMPLATE_URL, "10\.用户购买旅程模版\.pptx"\);\s*}/,
|
||
|
|
"模板按钮应调用后端内置文件下载"
|
||
|
|
);
|
||
|
|
});
|