Files
OpenFlare/frontend/tests/setup.ts
T
ryan 9609bec8b0 前端 axe 可访问性审计
axe-core(jsdom 结构性规则)真实 a11y 审计,超出 eslint 静态 jsx-a11y 的动态可访问性验证:登录页、注册页、登录 OTP 验证表单(input-otp 分段输入)、人机验证小部件(手动模式)、注册页开启人机验证(自动求解已通过态)五个表单态均零违规。环境修复:tests/setup.ts 补 ResizeObserver mock。

Experiments: #25, #26, #27
Metric: vitest 116 → 121,axe 结构性规则零违规
2026-08-16 21:23:37 +08:00

12 lines
342 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import '@testing-library/jest-dom/vitest';
// input-otp(登录 OTP 组件)依赖 ResizeObserver,jsdom 未内置
class ResizeObserverMock {
observe() {}
unobserve() {}
disconnect() {}
}
if (typeof globalThis.ResizeObserver === 'undefined') {
globalThis.ResizeObserver = ResizeObserverMock as unknown as typeof ResizeObserver;
}