fix(tests): 修复 CI 失败的测试 - 补充 withTranslation 和 CopyButton mock
- vitest.setup.ts: react-i18next mock 添加 withTranslation HOC(读取 zh/common.json 翻译) - vitest.setup.ts: 添加 @/components/CopyButton 全局 mock - App 测试: 补充 withTranslation 导出 - TextMode 测试: 修复多个 CopyButton 实例导致的 getByTestId 冲突,改用 getByRole
This commit is contained in:
@@ -21,6 +21,7 @@ vi.mock('react-i18next', () => ({
|
||||
useTranslation: () => ({
|
||||
t: (key: string) => key,
|
||||
}),
|
||||
withTranslation: () => (Component: any) => Component,
|
||||
}));
|
||||
|
||||
describe('Options App', () => {
|
||||
|
||||
Reference in New Issue
Block a user