新增 PlatformUiKit 通用弹窗、按钮、状态、空态、媒体、表单和标签等公共组件 迁移结果页、创作工作台、认证入口、RPG 暗色面板和运行态弹窗的重复 UI chrome 补充组件测试、页面回归测试、技术文档和 Hermes 共享决策记录
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
/* @vitest-environment jsdom */
|
|
|
|
import { render, screen } from '@testing-library/react';
|
|
import { expect, test } from 'vitest';
|
|
|
|
import { AffinityStatusCard } from './AffinityStatusCard';
|
|
|
|
test('renders affinity level with dark platform pill badge tone', () => {
|
|
render(<AffinityStatusCard affinity={72} />);
|
|
|
|
const levelBadge = screen.getAllByText('信任')[0]!;
|
|
|
|
expect(levelBadge.className).toContain('rounded-full');
|
|
expect(levelBadge.className).toContain('bg-amber-500/10');
|
|
expect(levelBadge.className).toContain('text-amber-100');
|
|
});
|
|
|
|
test('renders affinity summary and progress with dark PlatformSubpanel chrome', () => {
|
|
render(<AffinityStatusCard affinity={28} />);
|
|
|
|
const levelPanel = screen.getByText('好感等级').closest('section');
|
|
const progressPanel = screen.getByText('好感进度').closest('section');
|
|
|
|
expect(levelPanel?.className).toContain('border-white/10');
|
|
expect(levelPanel?.className).toContain('bg-black/25');
|
|
expect(levelPanel?.className).toContain('rounded-xl');
|
|
expect(progressPanel?.className).toContain('border-white/10');
|
|
expect(progressPanel?.className).toContain('bg-black/25');
|
|
expect(progressPanel?.className).toContain('sm:p-4');
|
|
});
|