From e6509dd9f1a9097eb81fc14ec9cdb8e91ba296cb Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期六, 05 九月 2026 12:00:52 +0800
Subject: [PATCH] 补充工步与项目图表契约测试

---
 tests/test-console-project-chart.contract.test.mjs |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/tests/test-console-project-chart.contract.test.mjs b/tests/test-console-project-chart.contract.test.mjs
new file mode 100644
index 0000000..1de6a1b
--- /dev/null
+++ b/tests/test-console-project-chart.contract.test.mjs
@@ -0,0 +1,21 @@
+import assert from 'node:assert/strict'
+import { readFile } from 'node:fs/promises'
+
+const chart = await readFile(new URL('../src/components/ConsoleProjectChartPanel.vue', import.meta.url), 'utf8')
+const consoleView = await readFile(new URL('../src/views/TestConsole.vue', import.meta.url), 'utf8')
+
+assert.match(chart, /PersistedTestStep/)
+assert.match(chart, /PersistedTestCycle/)
+assert.match(chart, /lastStepVoltage/)
+assert.match(chart, /endVoltage/)
+assert.match(chart, /dischargeCapacityPerFactor/)
+assert.match(chart, /capacityFactor/)
+assert.match(chart, /finalVoltage2/)
+assert.match(chart, /metric\.key !== 'finalVoltage2'/)
+assert.match(chart, /connectNulls: false/)
+assert.match(chart, /value === null \|\| value === undefined/)
+assert.match(consoleView, /getPersistedTestSteps/)
+assert.match(consoleView, /getPersistedTestCycles/)
+assert.match(consoleView, /projectCapacityFactor\.value = group\?\.specs\.f \|\| ''/)
+
+console.log('Ticket12 工步与项目图表契约通过')

--
Gitblit v1.7.1