fix(qa): 第五轮系统性质量保障缺陷修复 + 单元/集成测试
安全/鉴权:登出清服务端 httpOnly 令牌、登录 IP 限流前置 bcrypt、停用账号 令牌在 6 个内联 role handler 失效、admin/items 存在性 oracle 认证前置、 同意偏好 sanitize fail-closed、api-crypto 按 HTTP 方法判体。 CMS:workflow 状态更新+审计收进交互式 $transaction(失败即回滚)、编辑器 richtext 走 textarea 防换行损毁、array/object 子字段按作用域读写防污染、 about/contact/erp-upgrade 补 ISR revalidate 与路由映射。 UI/a11y:AnimatedCounter 入视口前显起点、CLS 累计上报、MetricCard 动画入 effect 并卸载取消 rAF、后台状态四态映射/搜索防抖+序号守卫/媒体单 input/ 吞错改横幅/表单 label-aria 关联。 新增对应判别性单测与 pagination/rate-limit/client-ip/sanitize/validate-content-data 等模块及 tests-integration 真库集成层。
This commit is contained in:
1 parent
040951c0a3
commit
a366bd1400
224 files changed
+8938
-5579
No files matched your search
@@ -131,6 +131,15 @@ describe('SectionHeader', () => {
|
||||
expect(heading.closest('h2')?.style.color).toBe('rgb(255, 255, 255)');
|
||||
});
|
||||
|
||||
it('washes the description white on dark sections and keeps it muted on light ones', async () => {
|
||||
const { SectionHeader } = await import('./section-header');
|
||||
const { unmount } = render(<SectionHeader label="TEST" title="Title" desc="深色底的说明文字" light />);
|
||||
expect(screen.getByText('深色底的说明文字').style.color).toBe('rgba(255, 255, 255, 0.5)');
|
||||
unmount();
|
||||
render(<SectionHeader label="TEST" title="Title" desc="浅色底的说明文字" />);
|
||||
expect(screen.getByText('浅色底的说明文字').style.color).toBe('var(--color-text-muted)');
|
||||
});
|
||||
|
||||
it('should apply custom className', async () => {
|
||||
const { SectionHeader } = await import('./section-header');
|
||||
render(<SectionHeader label="T" title="T" className="my-class" />);
|
||||
@@ -149,40 +158,6 @@ describe('SectionHeader', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('StatsBar', () => {
|
||||
const mockItems = [
|
||||
{ number: '500', unit: '+', label: '客户' },
|
||||
{ number: '99', unit: '%', label: '满意度', desc: '客户反馈评分' },
|
||||
];
|
||||
|
||||
it('should render stat items', async () => {
|
||||
const { StatsBar } = await import('./stats-bar');
|
||||
render(<StatsBar items={mockItems} />);
|
||||
expect(screen.getByText('客户')).toBeInTheDocument();
|
||||
expect(screen.getByText('满意度')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should render description when provided', async () => {
|
||||
const { StatsBar } = await import('./stats-bar');
|
||||
render(<StatsBar items={mockItems} />);
|
||||
expect(screen.getByText('客户反馈评分')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should apply custom className', async () => {
|
||||
const { StatsBar } = await import('./stats-bar');
|
||||
const { container } = render(<StatsBar items={mockItems} className="stats-class" />);
|
||||
const grid = container.querySelector('.stats-class');
|
||||
expect(grid).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should render in dark mode', async () => {
|
||||
const { StatsBar } = await import('./stats-bar');
|
||||
render(<StatsBar items={mockItems} dark />);
|
||||
const labels = screen.getAllByText('客户');
|
||||
expect(labels.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('ProductCard', () => {
|
||||
it('should render title, description and icon', async () => {
|
||||
const { ProductCard } = await import('./product-card');
|
||||
|
||||
Reference in new issue
Block a user