fix(a11y): 无障碍与 lint 修复(对比度/alt 属性/触控目标收窄)+ Geist 本地字体系统
This commit is contained in:
@@ -75,9 +75,11 @@ describe('InsightCard', () => {
|
||||
const { container } = render(
|
||||
<InsightCard {...mockInsight} featured image="/images/insights/trends.jpg" />
|
||||
);
|
||||
const img = container.querySelector('img');
|
||||
expect(img).toBeInTheDocument();
|
||||
expect(img).toHaveAttribute('src', '/images/insights/trends.jpg');
|
||||
// 组件用 CSS 背景图而非 <img>,使 404 图片静默降级为纯色底
|
||||
const bg = container.querySelector('[style*="background-image"]');
|
||||
expect(bg).toBeInTheDocument();
|
||||
expect(bg).toHaveAttribute('aria-hidden', 'true');
|
||||
expect(bg).toHaveStyle({ backgroundImage: 'url(/images/insights/trends.jpg)' });
|
||||
});
|
||||
|
||||
it('should render link element when provided', async () => {
|
||||
|
||||
Reference in New Issue
Block a user