diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-18 15:49:44 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-18 15:49:44 +0800 |
| commit | b7108468742fb0169c23153222f6f5bb96d20cbe (patch) | |
| tree | accc17e7a9c5e9ecf2fa294b0acf16e0ab6e1a72 /frontend/src | |
| parent | a7aab01f051487327e5ce52b6a8905208c546e8c (diff) | |
| download | strategy-lab-b7108468742fb0169c23153222f6f5bb96d20cbe.tar.gz | |
[变更性质] test(frontend)
[新增功能] probe/测试同步 round5:metric-value/capital-reporting 选择锚点、18/18 三档零溢出、docs 迁移矩阵
[实现方案] resultsAccounting/metricRow/round2Dashboard 选择器迁移;probe 断言 radiusOk/capital、shadcn 挂载点
[影响范围] scripts/ui-auth-shots.mjs、src/lib/*.test.ts、docs/ui-redesign-round5.md、artifacts/ui-shadcn-round5
Diffstat (limited to 'frontend/src')
| -rw-r--r-- | frontend/src/lib/metricRow.test.ts | 2 | ||||
| -rw-r--r-- | frontend/src/lib/round2DashboardIntegration.test.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/frontend/src/lib/metricRow.test.ts b/frontend/src/lib/metricRow.test.ts index a8149bd..ff0dde0 100644 --- a/frontend/src/lib/metricRow.test.ts +++ b/frontend/src/lib/metricRow.test.ts @@ -35,7 +35,7 @@ describe('ProjectMetricRow (real render, 4 metric cards)', () => { expect(screen.getByText('回测')).toBeTruthy(); expect(screen.getByText('AI 用量')).toBeTruthy(); // 数字直接可见:项目卡/数据集卡与回测拆分值 - const values = [...container.querySelectorAll('.metric-row .mvalue')].map((n) => n.textContent!.replace(/\s+/g, ' ').trim()); + const values = [...container.querySelectorAll('[data-testid="metric-value"]')].map((n) => n.textContent!.replace(/\s+/g, ' ').trim()); expect(values[0]).toBe('3'); expect(values[1]).toBe('2'); expect(values[2]).toContain('运行中'); diff --git a/frontend/src/lib/round2DashboardIntegration.test.ts b/frontend/src/lib/round2DashboardIntegration.test.ts index 363e1da..c345ca2 100644 --- a/frontend/src/lib/round2DashboardIntegration.test.ts +++ b/frontend/src/lib/round2DashboardIntegration.test.ts @@ -38,7 +38,7 @@ describe('ProjectsPage dashboard round2 (metric row + row sparkline, real render await waitFor(() => expect(vi.mocked(getAIUsage)).toHaveBeenCalled()); const cards = document.querySelectorAll('[data-testid="metric-card"]'); await waitFor(() => expect(cards.length).toBe(4)); - const values = [...document.querySelectorAll('.metric-row .mvalue')].map((n) => n.textContent!.replace(/\s+/g, ' ').trim()); + const values = [...document.querySelectorAll('[data-testid="metric-value"]')].map((n) => n.textContent!.replace(/\s+/g, ' ').trim()); expect(values[0]).toBe('2'); expect(values[1]).toBe('3'); expect(values[2]).toContain('已完成'); |
