我试图在 Jest 中从 react-i18next 模拟这个 Trans 组件:
<Trans
i18nKey="orderCards.business.paragraph"
components={{
p: <p />,
strong: <strong />,
Link: (
<BusinessAccountLink
to="/"
data-testid="business-account-link"
/>
),
}}
/>
It returns this: <p>Text <strong>Bold Text <Link>Click Me</Link></strong></p>
This link is a Link component from react-router-dom
我如何模拟这个组件,以便我可以测试链接是否在点击时有效。