test: 覆盖数据处理任务列表布局
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
"build": "vue-tsc -b && vite build",
|
"build": "vue-tsc -b && vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"type-check": "vue-tsc -b --noEmit",
|
"type-check": "vue-tsc -b --noEmit",
|
||||||
|
"test:data-process-list": "node scripts/regression-data-process-list.mjs",
|
||||||
"test:data-process-wizard": "node scripts/regression-data-process-wizard.mjs",
|
"test:data-process-wizard": "node scripts/regression-data-process-wizard.mjs",
|
||||||
"test:dataset-task-tab": "node scripts/regression-dataset-task-tab.mjs",
|
"test:dataset-task-tab": "node scripts/regression-dataset-task-tab.mjs",
|
||||||
"test:model-manage": "node scripts/regression-model-manage.mjs",
|
"test:model-manage": "node scripts/regression-model-manage.mjs",
|
||||||
|
|||||||
19
frontend/scripts/regression-data-process-list.mjs
Normal file
19
frontend/scripts/regression-data-process-list.mjs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import assert from 'node:assert/strict'
|
||||||
|
import { readFile } from 'node:fs/promises'
|
||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
|
import path from 'node:path'
|
||||||
|
import { parse as parseSfc } from '@vue/compiler-sfc'
|
||||||
|
|
||||||
|
const scriptDir = path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
const viewPath = path.resolve(scriptDir, '../src/views/data-process/DataProcessListView.vue')
|
||||||
|
const source = await readFile(viewPath, 'utf8')
|
||||||
|
const { descriptor, errors } = parseSfc(source, { filename: viewPath })
|
||||||
|
|
||||||
|
assert.equal(errors.length, 0, `数据处理任务列表模板无法解析:${errors[0]}`)
|
||||||
|
assert.ok(descriptor.template?.content.trim(), '数据处理任务列表缺少可渲染模板')
|
||||||
|
assert.match(source, /:data="dataList"/, '任务表格必须直接展示完整任务数据')
|
||||||
|
assert.doesNotMatch(source, /activeTab|filteredDataList/, '不应保留状态切换筛选逻辑')
|
||||||
|
assert.doesNotMatch(source, /全部任务|处理中|已完成/, '不应保留状态切换按钮文案')
|
||||||
|
assert.doesNotMatch(source, /capsule-tabs|capsule-tab-item/, '不应保留状态切换专用样式')
|
||||||
|
|
||||||
|
console.log('数据处理任务列表状态切换移除回归检查通过')
|
||||||
Reference in New Issue
Block a user