mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #35836 from overleaf/rh-prices-split
[web] Update monthly plan prices for new subscriptions with split test GitOrigin-RevId: 42d0adaf68647adc93f4c05d5ddeefb356753db2
This commit is contained in:
+31
@@ -61,6 +61,37 @@ describe('<ChangePlanModal />', function () {
|
||||
expect(screen.queryByText('loading', { exact: false })).to.be.null
|
||||
})
|
||||
|
||||
it('shows the price of the assigned price version for Stripe subscriptions', async function () {
|
||||
const stripeSubscription = {
|
||||
...annualActiveSubscription,
|
||||
service: 'stripe-us' as const,
|
||||
}
|
||||
// the backend resolves listPrice from the user's assigned price version;
|
||||
// the Recurly stub prices this plan at $23.00
|
||||
const plansWithListPrice = plans.map(plan => ({
|
||||
...plan,
|
||||
displayPrice: undefined,
|
||||
...(plan.planCode === 'collaborator' ? { listPrice: 25 } : {}),
|
||||
}))
|
||||
renderWithSubscriptionDashContext(
|
||||
<ActiveSubscription subscription={stripeSubscription} />,
|
||||
{
|
||||
metaTags: [
|
||||
{ name: 'ol-plans', value: plansWithListPrice },
|
||||
{ name: 'ol-groupPlans', value: groupPlans },
|
||||
{ name: 'ol-subscription', value: stripeSubscription },
|
||||
{ name: 'ol-recommendedCurrency', value: 'USD' },
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Change plan' }))
|
||||
|
||||
const priceCell = await screen.findByText('$25.00 / month')
|
||||
const row = priceCell.closest('tr') as HTMLTableRowElement
|
||||
within(row).getByText('Standard monthly')
|
||||
})
|
||||
|
||||
it('renders "Your new plan" and "Keep current plan" when there is a pending plan change', async function () {
|
||||
renderActiveSubscription(pendingSubscriptionChange)
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ export const annualActiveSubscription: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -93,6 +94,7 @@ export const pastDueActiveSubscription: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: true,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -140,6 +142,7 @@ export const annualActiveSubscriptionWithCoupons: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -185,6 +188,7 @@ export const pendingPausedSubscription: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -230,6 +234,7 @@ export const pausedSubscription: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -274,6 +279,7 @@ export const annualActiveSubscriptionWithAddons: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {
|
||||
@@ -321,6 +327,7 @@ export const annualActiveSubscriptionEuro: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '€221.96',
|
||||
planPrice: 179,
|
||||
planOnlyDisplayPrice: '€221.96',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -364,6 +371,7 @@ export const annualActiveSubscriptionPro: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$42.00',
|
||||
planPrice: 42,
|
||||
planOnlyDisplayPrice: '$42.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -408,6 +416,7 @@ export const pastDueExpiredSubscription: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: true,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -452,6 +461,7 @@ export const canceledSubscription: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -496,6 +506,7 @@ export const pendingAddOnChange: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [
|
||||
{
|
||||
@@ -554,6 +565,7 @@ export const pendingSubscriptionChange: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$199.00',
|
||||
planPrice: 199,
|
||||
planOnlyDisplayPrice: '$199.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -609,6 +621,7 @@ export const groupActiveSubscription: GroupSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$1290.00',
|
||||
planPrice: 1290,
|
||||
planOnlyDisplayPrice: '$1290.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -657,6 +670,7 @@ export const groupProfessionalActiveSubscription: GroupSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$1290.00',
|
||||
planPrice: 1290,
|
||||
planOnlyDisplayPrice: '$1290.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -706,6 +720,7 @@ export const groupActiveSubscriptionWithPendingLicenseChange: GroupSubscription
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$2967.00',
|
||||
planPrice: 1290,
|
||||
pendingAdditionalLicenses: 13,
|
||||
pendingTotalLicenses: 23,
|
||||
planOnlyDisplayPrice: '$2967.00',
|
||||
@@ -761,6 +776,7 @@ export const trialSubscription: PaidSubscription = {
|
||||
accountEmail: 'fake@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$14.00',
|
||||
planPrice: 14,
|
||||
planOnlyDisplayPrice: '$14.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -825,6 +841,7 @@ export const trialCollaboratorSubscription: PaidSubscription = {
|
||||
accountEmail: 'foo@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$21.00',
|
||||
planPrice: 21,
|
||||
planOnlyDisplayPrice: '$21.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
@@ -868,6 +885,7 @@ export const monthlyActiveCollaborator: PaidSubscription = {
|
||||
accountEmail: 'foo@example.com',
|
||||
hasPastDueInvoice: false,
|
||||
displayPrice: '$21.00',
|
||||
planPrice: 21,
|
||||
planOnlyDisplayPrice: '$21.00',
|
||||
addOns: [],
|
||||
addOnDisplayPricesWithoutAdditionalLicense: {},
|
||||
|
||||
Reference in New Issue
Block a user