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/market-opportunity-template...

26 lines
1.1 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/product/market-opportunity-selection.vue");
const source = fs.readFileSync(sourcePath, "utf8");
const templatePath = path.resolve(
__dirname,
"../../dianshang-houduan/src/main/resources/static/file/training-materials/market-opportunity-selection/6.数据表-抖音电商 - 计算模版.xlsx"
);
test("综合得分计算自动化模板从后端内置资料目录下载", () => {
assert.ok(fs.existsSync(templatePath), "自动化模板应随后端资源发布");
assert.match(
source,
/\/file\/training-materials\/market-opportunity-selection\/6\.数据表-抖音电商 - 计算模版\.xlsx/,
"下载按钮应指向后端文件服务"
);
assert.match(
source,
/function downloadTemplate\(\) \{ downloadBuiltInFile\(SCORE_CALCULATION_TEMPLATE_URL, "6\.数据表-抖音电商 - 计算模版\.xlsx"\); \}\nfunction downloadBuiltInFile/,
"自动化模板应通过后端内置文件下载"
);
});