yeg
2026-09-08 cfd4511378aefa04d4e06058cee628b6edd8e9c1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
 
const view = await readFile(new URL('../src/views/TestConsole.vue', import.meta.url), 'utf8')
const dataList = await readFile(new URL('../src/components/ConsoleDataListPanel.vue', import.meta.url), 'utf8')
const liveService = await readFile(new URL('../../BatteryDetection/battery-business/src/main/java/com/battery/business/service/impl/TTestLiveServiceImpl.java', import.meta.url), 'utf8')
 
assert.match(view, /<strong>项目参数<\/strong><span>STEP PARAMETERS<\/span>/)
assert.match(view, /testPlan\?\.rows/)
assert.match(view, /row\.rowType === 'CYCLE'/)
assert.match(view, /当前循环/)
assert.match(view, /`当前循环 \$\{row\.cycleCount \|\| '-'\}`/)
assert.match(view, /计划 \{\{ plannedCycleCount \|\| '-' \}\}/)
assert.doesNotMatch(view, /<strong>工步数据<\/strong><span>STEP SUMMARY<\/span>/)
assert.doesNotMatch(view, /visibleStepRows/)
assert.match(view, /logicStepMappings/)
assert.match(view, /selectedPlanSteps/)
assert.match(view, /合并选中/)
assert.match(view, /解除合并/)
assert.match(view, /startStepNo: positions\[0\], endStepNo: positions\[positions\.length - 1\]/)
assert.match(view, /const planRows = computed<PlanDisplayStep\[\]>\(\(\) => \{/)
assert.match(view, /const grouped = mapping \? physicalSteps\.filter/)
assert.match(view, /const physical = physicalSteps\.find\(item => item\.stepNo === row\.stepNo && item\.stepName === row\.stepName\) \|\| physicalSteps\.find\(item => item\.stepNo === row\.stepNo\)/)
assert.match(view, /displayRows\.push\(\{ no: mapping\?\.logicalNo \|\| row\.stepNo/)
assert.match(dataList, /起始电压\(V\)/)
assert.match(dataList, /放电谷值\(V\)/)
assert.match(dataList, /<th>工步<\/th>/)
assert.doesNotMatch(dataList, /<th>逻辑工步<\/th>/)
assert.doesNotMatch(dataList, /<th>实际工步<\/th>/)
assert.match(dataList, /activeTab\.value === 'step' \? stepRows\.value/)
assert.doesNotMatch(view.match(/<ConsoleDataListPanel\b[^]*?\/>/)[0], /:logic-step-mappings=/)
assert.doesNotMatch(view.match(/<ConsoleDataListPanel\b[^]*?\/>/)[0], /:plan-steps=/)
assert.doesNotMatch(dataList, /mappedStepRows/)
assert.doesNotMatch(dataList, /observedStepPositions/)
assert.doesNotMatch(dataList, /sumValue\('capacity'\)/)
assert.doesNotMatch(dataList, /logical-step:/)
assert.match(dataList, /const filteredRows = computed\(\(\) =>\r?\n  sourceRows\.value\.filter/)
assert.match(dataList, /:total="filteredRows\.length"/)
assert.doesNotMatch(dataList, /receptionIntervals/)
assert.match(dataList, /physicalIds/)
// 接收状态只触发同步,当前有效历史不因接收暂停或未开始而在前端清空。
assert.match(dataList, /if \(next !== previous\) void loadRecords\(\)/)
assert.match(liveService, /adapter\.testPlan\(new ChannelIdentity\(binding\.getAdapterCode\(\), binding\.getDevtype\(\)/)
assert.match(liveService, /source\.currentCycleNo\(\), source\.currentStepNo\(\)/)
assert.doesNotMatch(liveService, /simulator\.btsTest/)
assert.match(await readFile(new URL('../../BatteryDetection/battery-device-simulator/src/main/java/com/battery/device/simulator/BtsDevelopmentSimulator.java', import.meta.url), 'utf8'), /new PlanRow\("STEP", index \+ 1, index \+ 1,/)
 
console.log('Ticket23 实时工步方案与数据列表工步映射回归契约通过')