diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-18 12:03:32 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-18 12:03:32 +0800 |
| commit | 17e30105538f419c6abef2a69ffd4f0eb4cf238b (patch) | |
| tree | 23b79c0b4f0f7aca67a3e33ae88b95cb9a991ec0 /frontend/src/lib/mobileCss.test.ts | |
| parent | 61f5c545953bb4ee20b123bf9671ac35d7f1f3c1 (diff) | |
| download | strategy-lab-17e30105538f419c6abef2a69ffd4f0eb4cf238b.tar.gz | |
[变更性质] 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
Diffstat (limited to 'frontend/src/lib/mobileCss.test.ts')
| -rw-r--r-- | frontend/src/lib/mobileCss.test.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/frontend/src/lib/mobileCss.test.ts b/frontend/src/lib/mobileCss.test.ts index c4d1efb..af7251f 100644 --- a/frontend/src/lib/mobileCss.test.ts +++ b/frontend/src/lib/mobileCss.test.ts @@ -47,6 +47,41 @@ describe('375px responsive sizing (no global content hiding)', () => { }); }); +describe('round3 shadcn-svelte 主题 tokens(b1D0dv72 preset 精神 + 截图重配)', () => { + it('radius 上调至 0.75rem(Stripe 风格大圆角),shadcn radius-lg 由此派生', () => { + expect(appCss).toMatch(/--radius:\s*0\.75rem/); + expect(appCss).toMatch(/--radius-lg:\s*var\(--radius\)/); + }); + + it('mint 默认 + amber 双套变量组(用户 create 截图色值)', () => { + // mint ~#70DAB6 / 深一档 #58D3AA;amber ~#F0AE00 + expect(appCss).toContain('--brand: #58d3aa'); + expect(appCss).toContain('--ring: #70dab6'); + expect(appCss).toMatch(/\.theme-amber\s*\{/); + expect(appCss).toContain('--brand: #f0ae00'); + // 默认 mint、amber 仅通过 .theme-amber 切换(src/lib/theme.ts 挂类) + expect(appCss).not.toMatch(/NAVER/); + }); + + it('数字排印:tabular-nums 大字重(mvalue 1.5rem/700),保留 .num/.metric-grid', () => { + expect(appCss).toMatch(/\.mvalue\s*\{[^}]*font-weight:\s*700/); + expect(appCss).toMatch(/\.mvalue\s*\{[^}]*font-variant-numeric:\s*tabular-nums/); + expect(appCss).toContain('.metric-grid {'); + }); + + it('legacy 组件选择器已从 app.css 删除(.btn/.banner 变体/.badge/.tabs/table.data 组件样式)', () => { + expect(appCss).not.toMatch(/\.btn\s*\{|\.\btn\.|\.btn\./); + expect(appCss).not.toContain('.btn.primary {'); + expect(appCss).not.toContain('.badge.teal {'); + expect(appCss).not.toContain('.tabs button {'); + expect(appCss).not.toContain('table.data th {'); + expect(appCss).not.toContain('.metric {'); + expect(appCss).not.toContain('.metric-card {'); + // .banner 仅剩窄视口防溢出工具(无颜色组件样式) + expect(appCss).not.toContain('.banner.error {'); + }); +}); + function getMediaBlock(css, query) { const idx = css.indexOf(`@media ${query}`); if (idx < 0) return null; |
