You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dianshang-qianduan/tests/product-development-process...

29 lines
1.8 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const test = require("node:test");
const source = fs.readFileSync(path.join(__dirname, "../src/views/foundation/product-development-process.vue"), "utf8");
test("实训任务三第二步在提交前提示首个未填写字段", () => {
assert.match(source, /function getStepTwoValidationMessage\(\)[\s\S]*?请填写任务 \$\{row\.taskNo\} 的项目依赖关系/);
assert.match(source, /function getStepTwoValidationMessage\(\)[\s\S]*?请填写任务 \$\{row\.taskNo\} 的开始时间[\s\S]*?请填写任务 \$\{row\.taskNo\} 的完成时间/);
});
test("实训任务三第二步不完整时不请求后端校验", () => {
assert.match(source, /async function saveAndGoToStepThree\(\)\s*\{[\s\S]*?const validationMessage = getStepTwoValidationMessage\(\);[\s\S]*?if \(validationMessage\) \{[\s\S]*?msgWarning\?\.\(validationMessage\)[\s\S]*?return;[\s\S]*?\}\s*checking\.value = true;[\s\S]*?checkProductDevelopmentProcessStepTwo/);
});
test("实训任务三第二步可导出当前WBS排期列表", () => {
assert.match(source, /@click="exportScheduleList"[\s\S]*?导出列表/);
assert.match(source, /function exportScheduleList\(\)[\s\S]*?XLSX\.utils\.json_to_sheet[\s\S]*?XLSX\.writeFile[\s\S]*?产品开发WBS任务拆解与排期表\.xlsx/);
});
test("实训任务三第二步使用标准SS依赖示例并采用紧凑表格", () => {
assert.match(source, /placeholder="示例:开始-开始SS"/);
assert.match(source, /\.schedule-table \.dependency-input::placeholder \{ color: rgba\(168, 220, 233, \.68\); opacity: 1; \}/);
assert.match(source, /\.schedule-table \{ min-width: 1020px; \}/);
assert.match(source, /\.schedule-table \.stage-cell \{ width: 7%; \}/);
assert.match(source, /\.schedule-table \.task-no-cell \{ width: 7%; \}/);
});