From 375584174fb7191a57c5423fea45924ad6d812d5 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Fri, 18 Sep 2026 15:49:44 +0800 Subject: [变更性质] feat(frontend) [新增功能] round5 主题基线重置:shadcn preset b6t6C6CTw CLI init、app.css 仅保留 tailwind + shadcn 主题变量层 [实现方案] 删除 round3 自定义 token/布局原语/legacy 别名;theme.ts 删除;mobileCss 守门测试重写 [影响范围] src/app.css、components.json、lib/utils.ts、lib/theme.ts、测试 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lib/resultsAccounting.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'frontend/src/lib/resultsAccounting.test.ts') diff --git a/frontend/src/lib/resultsAccounting.test.ts b/frontend/src/lib/resultsAccounting.test.ts index 5dc5bd6..deedaa9 100644 --- a/frontend/src/lib/resultsAccounting.test.ts +++ b/frontend/src/lib/resultsAccounting.test.ts @@ -71,17 +71,17 @@ describe('results accounting labels + values (live browser accounting)', () => { expect(text).not.toContain('成交次数(不含撤单)'); // numeric trade_count shows through: equity div reached rendering // 投入口径 reporting(任务 A)追加 3 张卡:累计投入/持仓估值/回报率 → 9 - expect(host.querySelectorAll('[data-slot="card"].m-tile, .m-tile').length).toBe(9); + expect(host.querySelectorAll('[data-slot="card"].gap-1').length).toBe(9); expect(host.querySelectorAll('[data-testid="capital-reporting"]').length).toBe(1); expect(text).toContain('累计投入'); expect(text).toContain('投入口径不含初始账户闲置现金'); // turnover: two fills with distinct values (buy vs sell prices differ) - const rows = [...host.querySelectorAll('td.num')].map((td) => td.textContent.trim()); + const rows = [...host.querySelectorAll('[data-testid="capital-reporting"]').length ? host.querySelectorAll('td') : []].length >= 0 ? [...host.querySelectorAll('td')].map((td) => td.textContent.trim()) : []; const hasSell = [...host.children].join('').includes('卖出'); // the trades table renders the sell row with its OWN value (1040), not the buy's cost basis expect(rows.filter((v) => v === '1020.00' || v === '1040.00').length).toBe(2); // trade_count metric value renders - expect([...host.querySelectorAll('.mvalue')].some((n) => n.textContent === '1')).toBe(true); + expect([...host.querySelectorAll('[data-testid="metric-value"]')].some((n) => n.textContent === '1')).toBe(true); } finally { unmount(inst); host.remove(); vi.unstubAllGlobals(); } }); it('comparison labels use the same closed-round-trip semantics', () => { -- cgit v1.2.3