overleaf/services/web/test/frontend/features/subscription/helpers/render-active-subscription.tsx
Jessica Lawshe 124306d7ac Merge pull request #11819 from overleaf/jel-subscription-dash-change-to-group-prices
[web] Show price in change to group plan modal on React subscription dash

GitOrigin-RevId: 6a1a4be3a7d008cd9e26186c2d97bc0bdc2f82ed
2023-02-22 09:05:13 +00:00

31 lines
1,007 B
TypeScript

import { ActiveSubscription } from '../../../../../frontend/js/features/subscription/components/dashboard/states/active/active'
import { Subscription } from '../../../../../types/subscription/dashboard/subscription'
import { groupPlans, plans } from '../fixtures/plans'
import { renderWithSubscriptionDashContext } from './render-with-subscription-dash-context'
export function renderActiveSubscription(
subscription: Subscription,
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
)
}