完成招聘双Sheet导入改造
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const componentPath = path.resolve(
|
||||
__dirname,
|
||||
"../../src/views/ccdiStaffRecruitment/index.vue"
|
||||
);
|
||||
const source = fs.readFileSync(componentPath, "utf8");
|
||||
|
||||
[
|
||||
'label="失败Sheet"',
|
||||
'label="失败行号"',
|
||||
"scope.row.sheetName",
|
||||
"scope.row.sheetRowNum",
|
||||
"失败原因"
|
||||
].forEach((token) => {
|
||||
assert(source.includes(token), `招聘失败弹窗缺少双Sheet定位列: ${token}`);
|
||||
});
|
||||
|
||||
console.log("staff-recruitment-import-failure-dialog test passed");
|
||||
28
ruoyi-ui/tests/unit/staff-recruitment-import-state.test.js
Normal file
28
ruoyi-ui/tests/unit/staff-recruitment-import-state.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const componentPath = path.resolve(
|
||||
__dirname,
|
||||
"../../src/views/ccdiStaffRecruitment/index.vue"
|
||||
);
|
||||
const source = fs.readFileSync(componentPath, "utf8");
|
||||
|
||||
[
|
||||
"模板包含“招聘信息”和“历史工作经历”两个 Sheet。",
|
||||
"this.currentTaskId = taskId",
|
||||
"this.showFailureButton = false",
|
||||
"this.startImportStatusPolling(taskId)"
|
||||
].forEach((token) => {
|
||||
assert(source.includes(token), `招聘导入状态未统一到单任务: ${token}`);
|
||||
});
|
||||
|
||||
[
|
||||
"currentImportType",
|
||||
"upload.importType",
|
||||
"getImportTypeLabel"
|
||||
].forEach((token) => {
|
||||
assert(!source.includes(token), `招聘导入状态不应再按类型拆分: ${token}`);
|
||||
});
|
||||
|
||||
console.log("staff-recruitment-import-state test passed");
|
||||
34
ruoyi-ui/tests/unit/staff-recruitment-import-toolbar.test.js
Normal file
34
ruoyi-ui/tests/unit/staff-recruitment-import-toolbar.test.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const pagePath = path.resolve(
|
||||
__dirname,
|
||||
"../../src/views/ccdiStaffRecruitment/index.vue"
|
||||
);
|
||||
const apiPath = path.resolve(
|
||||
__dirname,
|
||||
"../../src/api/ccdiStaffRecruitment.js"
|
||||
);
|
||||
|
||||
const pageSource = fs.readFileSync(pagePath, "utf8");
|
||||
const apiSource = fs.readFileSync(apiPath, "utf8");
|
||||
const source = `${pageSource}\n${apiSource}`;
|
||||
|
||||
[
|
||||
"handleImport()",
|
||||
'"/ccdi/staffRecruitment/importData"',
|
||||
"招聘信息管理导入模板"
|
||||
].forEach((token) => {
|
||||
assert(source.includes(token), `招聘导入入口缺少统一双Sheet能力: ${token}`);
|
||||
});
|
||||
|
||||
[
|
||||
"handleWorkImport",
|
||||
"importWorkData",
|
||||
"workImportTemplate"
|
||||
].forEach((token) => {
|
||||
assert(!source.includes(token), `招聘页不应继续保留独立工作经历导入: ${token}`);
|
||||
});
|
||||
|
||||
console.log("staff-recruitment-import-toolbar test passed");
|
||||
Reference in New Issue
Block a user