Files
ccdi/ruoyi-ui/tests/unit/preliminary-check-project-analysis-entry.test.js

51 lines
1.4 KiB
JavaScript
Raw Normal View History

const assert = require("assert");
const fs = require("fs");
const path = require("path");
const entry = fs.readFileSync(
path.resolve(
__dirname,
"../../src/views/ccdiProject/components/detail/PreliminaryCheck.vue"
),
"utf8"
);
const people = fs.readFileSync(
path.resolve(
__dirname,
"../../src/views/ccdiProject/components/detail/RiskPeopleSection.vue"
),
"utf8"
);
const model = fs.readFileSync(
path.resolve(
__dirname,
"../../src/views/ccdiProject/components/detail/RiskModelSection.vue"
),
"utf8"
);
[
'import ProjectAnalysisDialog from "./ProjectAnalysisDialog";',
"ProjectAnalysisDialog",
"projectAnalysisDialogVisible",
"<project-analysis-dialog",
':visible.sync="projectAnalysisDialogVisible"',
].forEach((token) => assert(entry.includes(token), token));
[
'@view-project-analysis="handleRiskPeopleProjectAnalysis"',
'@view-project-analysis="handleRiskModelProjectAnalysis"',
].forEach((token) => assert(entry.includes(token), token));
[
'@click="handleViewProject(scope.row)"',
'$emit("view-project-analysis", row)',
'scope.row.actionLabel || "查看项目"',
].forEach((token) => assert(people.includes(token), token));
[
'@click="handleViewProject(scope.row)"',
'$emit("view-project-analysis", row)',
'scope.row.actionLabel || "查看项目"',
].forEach((token) => assert(model.includes(token), token));