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/ruoyi-system/src/main/java/com/ruoyi/system/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, /:logic-step-mappings=/)
|
assert.doesNotMatch(view, /: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\(\(\) =>\n sourceRows\.value\.filter/)
|
assert.match(dataList, /:total="filteredRows\.length"/)
|
assert.doesNotMatch(dataList, /receptionIntervals/)
|
assert.match(dataList, /physicalIds/)
|
assert.match(dataList, /props\.receptionStatus === 'NOT_STARTED'/)
|
assert.match(liveService, /simulator\.btsTest\(battery\.getBinding\(\)\.getDevid\(\), battery\.getBinding\(\)\.getChlid\(\), 1\)/)
|
assert.match(await readFile(new URL('../../BatteryDetection/ruoyi-device/src/main/java/com/ruoyi/device/bts/BtsDevelopmentSimulator.java', import.meta.url), 'utf8'), /Integer cyclePosition/)
|
|
console.log('Ticket23 实时工步方案与数据列表工步映射回归契约通过')
|