refactor: create shared react-i18next mock to reduce duplication (#29711)

This commit is contained in:
yyh
2025-12-16 12:45:17 +08:00
committed by GitHub
parent 4cc6652424
commit eeb5129a17
40 changed files with 58 additions and 228 deletions

View File

@@ -5,12 +5,6 @@ import PlanUpgradeModal from './index'
const mockSetShowPricingModal = jest.fn()
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (key: string) => key,
}),
}))
jest.mock('@/app/components/base/modal', () => {
const MockModal = ({ isShow, children }: { isShow: boolean; children: React.ReactNode }) => (
isShow ? <div data-testid="plan-upgrade-modal">{children}</div> : null