const assert = require("assert");
const fs = require("fs");
const path = require("path");

const dialogPath = path.resolve(__dirname, "../../src/views/ccdiProject/components/ImportHistoryDialog.vue");
const source = fs.readFileSync(dialogPath, "utf8");

assert(source.includes("listHistoryProjects("), "应通过真实历史项目接口加载数据");
assert(source.includes("importFromHistory("), "应通过真实导入接口提交");
assert(source.includes("this.$emit('submit', response.data)"), "提交成功后应向父组件返回新项目数据");
assert(source.includes("请选择历史项目"), "未选择历史项目时应提示用户先选择来源项目");
assert(source.includes("请输入新项目名称"), "未填写新项目名称时应展示必填校验文案");

console.log("project-import-history-dialog-behavior test passed");
