Files
gsfdc/demo-dify/dify/web/__tests__/billing/self-hosted-plan-flow.test.tsx
T
wuzilongandCursor 6519682885 chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 13:59:25 +08:00

24 lines
995 B
TypeScript

import { screen } from '@testing-library/react'
import { SELF_HOSTED_PLAN_URLS } from '@/app/components/billing/config'
import { SelfHostedPlanItem } from '@/app/components/billing/pricing/plans/self-hosted-plan-item'
import { render } from '@/test/console/render'
vi.mock('@/app/components/billing/pricing/plans/self-hosted-plan-item/list', () => ({
SelfHostedPlanFeatures: () => null,
}))
describe('Self-hosted plan destinations', () => {
it.each([
['community', SELF_HOSTED_PLAN_URLS.community],
['premium', SELF_HOSTED_PLAN_URLS.premium],
['enterprise', SELF_HOSTED_PLAN_URLS.enterprise],
] as const)('links the %s plan to its purchase or download destination', (plan, href) => {
render(<SelfHostedPlanItem plan={plan} />)
expect(screen.getByRole('heading', { name: `billing.plans.${plan}.name` })).toBeInTheDocument()
expect(
screen.getByRole('link', { name: new RegExp(`billing.plans.${plan}.btnText`) }),
).toHaveAttribute('href', href)
})
})