overleaf/services/web/test/frontend/features/subscription/helpers/render-active-subscription.tsx
Alexandre Bourdin d2fb800174 Merge pull request #11885 from overleaf/ab-personal-sub-custom-react
[web] Display a message for custom personal subscriptions in React dash

GitOrigin-RevId: c70986ffacfdfdeccd3675385e2e5dba1a2ad61f
2023-02-23 09:05:13 +00:00

31 lines
1,021 B
TypeScript

import { ActiveSubscription } from '../../../../../frontend/js/features/subscription/components/dashboard/states/active/active'
import { RecurlySubscription } from '../../../../../types/subscription/dashboard/subscription'
import { groupPlans, plans } from '../fixtures/plans'
import { renderWithSubscriptionDashContext } from './render-with-subscription-dash-context'
export function renderActiveSubscription(
subscription: RecurlySubscription,
tags: { name: string; value: string | object | Array<object> }[] = [],
currencyCode?: string
) {
const renderOptions = {
currencyCode,
metaTags: [
...tags,
{ name: 'ol-plans', value: plans },
{
name: 'ol-groupPlans',
value: groupPlans,
},
{ name: 'ol-subscription', value: subscription },
{
name: 'ol-recommendedCurrency',
value: currencyCode || 'USD',
},
],
}
renderWithSubscriptionDashContext(
<ActiveSubscription subscription={subscription} />,
renderOptions
)
}