改造流水明细详情弹窗并统一列表样式
This commit is contained in:
46
ruoyi-ui/tests/unit/detail-query-detail-dialog.test.js
Normal file
46
ruoyi-ui/tests/unit/detail-query-detail-dialog.test.js
Normal file
@@ -0,0 +1,46 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const componentPath = path.resolve(
|
||||
__dirname,
|
||||
"../../src/views/ccdiProject/components/detail/DetailQuery.vue"
|
||||
);
|
||||
const source = fs.readFileSync(componentPath, "utf8");
|
||||
|
||||
assert(
|
||||
source.includes("<el-dialog"),
|
||||
"详情应改为 el-dialog 弹窗展示"
|
||||
);
|
||||
|
||||
assert(
|
||||
!source.includes("<el-drawer"),
|
||||
"详情不应再使用抽屉展示"
|
||||
);
|
||||
|
||||
[
|
||||
'class="detail-dialog"',
|
||||
'class="detail-overview-grid"',
|
||||
'class="detail-dialog-footer"',
|
||||
"formatCounterpartyName(detailData)",
|
||||
"formatOriginalFileName(detailData)",
|
||||
'width="980px"',
|
||||
].forEach((token) => {
|
||||
assert(
|
||||
source.includes(token),
|
||||
`详情弹窗缺少关键结构或方法: ${token}`
|
||||
);
|
||||
});
|
||||
|
||||
const tableBlockMatch = source.match(/<el-table[\s\S]*?class="result-table"[\s\S]*?>/m);
|
||||
assert(tableBlockMatch, "未找到流水明细列表表格");
|
||||
assert(
|
||||
!/\sborder(\s|>)/.test(tableBlockMatch[0]),
|
||||
"流水明细列表不应再启用表格边框"
|
||||
);
|
||||
assert(
|
||||
!/\sstripe(\s|>)/.test(tableBlockMatch[0]),
|
||||
"流水明细列表不应再启用斑马纹"
|
||||
);
|
||||
|
||||
console.log("detail-query-detail-dialog test passed");
|
||||
Reference in New Issue
Block a user