31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
const assert = require("assert");
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
const componentPath = path.resolve(
|
|
__dirname,
|
|
"../../src/views/ccdiProject/components/detail/UploadData.vue"
|
|
);
|
|
const source = fs.readFileSync(componentPath, "utf8");
|
|
|
|
assert(
|
|
/<div class="header-actions">[\s\S]*?@click="handleOpenBatchUploadDialog"[\s\S]*?>\s*上传流水\s*<\/el-button>[\s\S]*?@click="handleViewReport"[\s\S]*?>\s*查看报告\s*<\/el-button>[\s\S]*?@click="handleFetchBankInfo"[\s\S]*?>\s*拉取本行信息\s*<\/el-button>[\s\S]*?@click="handleGoCreditInfoPage"[\s\S]*?>\s*征信导入\s*<\/el-button>/.test(
|
|
source
|
|
),
|
|
"页面右上角按钮顺序应为上传流水、查看报告、拉取本行信息、征信导入"
|
|
);
|
|
|
|
assert(
|
|
/<el-button[\s\S]*?type="primary"[\s\S]*?@click="handleOpenBatchUploadDialog"[\s\S]*?>\s*上传流水\s*<\/el-button>/.test(
|
|
source
|
|
),
|
|
"上传流水按钮应为头部唯一主按钮"
|
|
);
|
|
|
|
assert(
|
|
!/uploadCards:/.test(source) && !/class="upload-cards"/.test(source),
|
|
"上传卡片数据和模板应已清理"
|
|
);
|
|
|
|
console.log("upload-data-header-import-button test passed");
|