fix(ui): 修复首页试听条文字折行问题,完善单行文本省略截断规范与文案精简
这个提交包含在:
@@ -82,8 +82,17 @@ describe('ThemeManager (TDD 测试套件: 暖色系与双主题设计系统)', (
|
||||
});
|
||||
});
|
||||
|
||||
describe('2. WCAG AA 级无障碍色彩对比度验证', () => {
|
||||
it('暖色系一级主文本 (textPrimary) 对底色与卡片底色对比度必须 >= 7:1 (超越 AA 级 4.5:1)', () => {
|
||||
describe('2. WCAG AA 级无障碍色彩对比度与浅色特征验证', () => {
|
||||
it('浅色暖色系底色必须为明亮浅色 (相对亮度 > 0.85)', () => {
|
||||
const tokens = THEMES[THEME_KEYS.WARM].tokens;
|
||||
const bgLum = getLuminance(tokens.bgPrimary);
|
||||
const surfaceLum = getLuminance(tokens.bgSurface);
|
||||
|
||||
expect(bgLum).toBeGreaterThanOrEqual(0.85);
|
||||
expect(surfaceLum).toBeGreaterThanOrEqual(0.95);
|
||||
});
|
||||
|
||||
it('浅色暖色系一级主文本 (textPrimary) 对浅色底与卡片底色对比度必须 >= 7:1 (超越 AA 级 4.5:1)', () => {
|
||||
const tokens = THEMES[THEME_KEYS.WARM].tokens;
|
||||
const ratioOnBg = getContrastRatio(tokens.textPrimary, tokens.bgPrimary);
|
||||
const ratioOnSurface = getContrastRatio(tokens.textPrimary, tokens.bgSurface);
|
||||
@@ -92,7 +101,7 @@ describe('ThemeManager (TDD 测试套件: 暖色系与双主题设计系统)', (
|
||||
expect(ratioOnSurface).toBeGreaterThanOrEqual(7.0);
|
||||
});
|
||||
|
||||
it('暖色系二级辅助文本 (textSecondary) 对底色对比度必须 >= 4.5:1 (符合 WCAG AA 标准)', () => {
|
||||
it('浅色暖色系二级辅助文本 (textSecondary) 对浅色底对比度必须 >= 4.5:1 (符合 WCAG AA 标准)', () => {
|
||||
const tokens = THEMES[THEME_KEYS.WARM].tokens;
|
||||
const ratio = getContrastRatio(tokens.textSecondary, tokens.bgPrimary);
|
||||
|
||||
@@ -106,12 +115,12 @@ describe('ThemeManager (TDD 测试套件: 暖色系与双主题设计系统)', (
|
||||
expect(themeManager.getCurrentTheme().name).toBe('冷光暗夜');
|
||||
});
|
||||
|
||||
it('成功切换到 warm (暖阳赤焰) 主题', () => {
|
||||
it('成功切换到 warm (暖阳晨曦) 浅色暖色系主题', () => {
|
||||
const current = themeManager.switchTheme(THEME_KEYS.WARM);
|
||||
expect(current.key).toBe(THEME_KEYS.WARM);
|
||||
expect(current.name).toBe('暖阳赤焰');
|
||||
expect(current.name).toBe('暖阳晨曦');
|
||||
expect(themeManager.getCurrentThemeKey()).toBe(THEME_KEYS.WARM);
|
||||
expect(themeManager.getCurrentTokens().colorBrand).toBe('#F97316');
|
||||
expect(themeManager.getCurrentTokens().colorBrand).toBe('#EA580C');
|
||||
});
|
||||
|
||||
it('传入非法主题标识时,应平滑回退到默认 cool 主题,确保系统不崩溃', () => {
|
||||
|
||||
在新工单中引用
屏蔽一个用户