From 17e30105538f419c6abef2a69ffd4f0eb4cf238b Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Fri, 18 Sep 2026 12:03:32 +0800 Subject: [变更性质] test(frontend) [新增功能] 测试与 probe 同步:mobileCss round3 断言、resultsAccounting .m-tile、strategyTab 超时放宽、probe radius 断言 [实现方案] probe cardRadiusOk 校验 --radius≥0.75rem 且组件计算圆角一致;88/88 vitest 全绿 [影响范围] src/lib/*.test.ts、scripts/ui-auth-shots.mjs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/scripts/ui-auth-shots.mjs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'frontend/scripts') diff --git a/frontend/scripts/ui-auth-shots.mjs b/frontend/scripts/ui-auth-shots.mjs index 9507b6d..2db1f1d 100644 --- a/frontend/scripts/ui-auth-shots.mjs +++ b/frontend/scripts/ui-auth-shots.mjs @@ -155,6 +155,22 @@ for (const w of widths) { breadcrumbText: document.querySelector('nav.crumbs')?.textContent.replace(/\s+/g, ' ').trim() || null, sparklineCells: document.querySelectorAll('[data-testid="sparkline-cell"]').length, metricCards: document.querySelectorAll('[data-testid="metric-card"]').length, + cardRadius: (function () { + const r = document.querySelector('[data-slot="card"]'); + if (!r) return null; + const target = String(getComputedStyle(document.documentElement).getPropertyValue('--radius')).trim(); + return { computed: getComputedStyle(r).borderRadius, token: getComputedStyle(document.documentElement).getPropertyValue('--radius') || target }; + })(), + cardRadiusOk: (function () { + const r = document.querySelector('[data-slot="card"]'); + if (!r) return null; + const root = getComputedStyle(document.documentElement); + const tok = parseFloat(root.getPropertyValue('--radius')); + const rootFs = parseFloat(root.fontSize); + const expected = tok * rootFs; + const n = parseFloat(getComputedStyle(r).borderRadius); + return n >= expected - 0.5 && tok >= 0.749; + })(), projects: (window.__probeProjects !== undefined) ? window.__probeProjects : null, runs: null, hasEquity: null, @@ -170,6 +186,7 @@ for (const w of widths) { ' overflow=' + dom.overflow + ' pageErrors=' + pageErrors.length + ' tabbarAttached=' + dom.tabbarAttached + ' tabbarVisible=' + dom.tabbarVisible + ' metricCards=' + dom.metricCards + ' sparks=' + dom.sparklineCells + + ' radiusOk=' + dom.cardRadiusOk + (dom.breadcrumbText ? ' crumbs="' + dom.breadcrumbText + '"' : '') ); if (dom.overflow !== 0 || pageErrors.length !== 0) bad++; -- cgit v1.2.3