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/release-channel-toolbar-pla...

19 lines
941 B
JavaScript

const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const test = require("node:test");
const frontendRoot = path.resolve(__dirname, "..");
const page = fs.readFileSync(path.join(frontendRoot, "src/views/test/index.vue"), "utf8");
const brief = fs.readFileSync(path.join(frontendRoot, "src/views/components/TrainingTaskBrief.vue"), "utf8");
test("产品发布渠道评估将任务工具栏放在步骤标题右侧", () => {
assert.match(page, /<TrainingTaskBrief[\s\S]*?:show-toolbar="false"[\s\S]*?\/>/);
assert.match(page, /<header class="workbench-head">[\s\S]*?<TrainingTaskToolbar(?=[^>]*task-key="release-channel-evaluation")[^>]*\/>[\s\S]*?<\/header>/);
});
test("任务说明组件支持按页面隐藏顶部工具栏", () => {
assert.match(brief, /showToolbar:\s*\{[\s\S]*?default:\s*true/);
assert.match(brief, /<TrainingTaskToolbar\s+v-if="showToolbar"/);
});