Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,10 @@ describe('TeamPlanCard', () => {
wrapper,
})

const yearlyPrice = await screen.findByText(/5/)
expect(yearlyPrice).toBeInTheDocument()

const monthlyPrice = await screen.findByText(/6/)
expect(monthlyPrice).toBeInTheDocument()

const auxiliaryText = await screen.findByText(/per user billing monthly/)
const auxiliaryText = await screen.findByText(/billed monthly/)
expect(auxiliaryText).toBeInTheDocument()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ const TeamPlanCard: React.FC = () => {
<p className="text-xs font-semibold">Pricing</p>
<div>
<p className="font-semibold">
<span className="text-2xl">${teamPlanYear?.baseUnitPrice}</span>{' '}
<span className="text-2xl">${teamPlanMonth?.baseUnitPrice}</span>{' '}
per user/month
</p>
<p className="text-ds-gray-senary">
billed annually, or ${teamPlanMonth?.baseUnitPrice} per user
billing monthly
</p>
<p className="text-ds-gray-senary">billed monthly</p>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const sentryPlans = [
marketingName: 'Sentry',
value: Plans.USERS_SENTRYM,
billingRate: null,
baseUnitPrice: 0,
baseUnitPrice: 12,
benefits: ['Includes 5 seats', 'Unlimited public repositories'],
monthlyUploadLimit: null,
isTeamPlan: false,
Expand Down Expand Up @@ -362,15 +362,13 @@ describe('FreePlanCard', () => {
wrapper,
})

const cost = await screen.findByText(/\$10/)
const cost = await screen.findByText(/\$12/)
expect(cost).toBeInTheDocument()

const annualBillingText = await screen.findByText(/per user\/month/)
expect(annualBillingText).toBeInTheDocument()
const billingText = await screen.findByText(/per user\/month/)
expect(billingText).toBeInTheDocument()

const monthlyBillingText = await screen.findByText(
/billed annually, or \$12 per user billing monthly/
)
const monthlyBillingText = await screen.findByText(/billed monthly/)
expect(monthlyBillingText).toBeInTheDocument()
})

Expand Down Expand Up @@ -506,7 +504,7 @@ describe('FreePlanCard', () => {
expect(perMonth).toBeInTheDocument()

const billingCycleInfo = await screen.findByText(
/over 5 users is \$10 per user\/month, billed annually/
/over 5 users is \$12 per user\/month, billed monthly/
)
expect(billingCycleInfo).toBeInTheDocument()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import ProPlanSubheading from '../ProPlanSubheading'

function PlanDetails({
isSentryUpgrade,
sentryAnnualUnitPrice,
sentryMonthlyUnitPrice,
proMonthlyUnitPrice,
proYearlyUnitPrice,
}) {
if (isSentryUpgrade) {
return (
Expand All @@ -22,8 +21,8 @@ function PlanDetails({
/month
</p>
<p className="text-ds-gray-senary">
over 5 users is ${sentryAnnualUnitPrice} per user/month, billed
annually
over 5 users is ${sentryMonthlyUnitPrice} per user/month, billed
monthly
</p>
</div>
)
Expand All @@ -32,27 +31,24 @@ function PlanDetails({
return (
<div className="text-xs">
<p className="font-semibold">
<span className="text-2xl">${proYearlyUnitPrice}</span> per user/month
</p>
<p className="text-ds-gray-senary">
billed annually, or ${proMonthlyUnitPrice} per user billing monthly
<span className="text-2xl">${proMonthlyUnitPrice}</span> per user/month
</p>
<p className="text-ds-gray-senary">billed monthly</p>
</div>
)
}

PlanDetails.propTypes = {
isSentryUpgrade: PropType.bool.isRequired,
sentryAnnualUnitPrice: PropType.number,
sentryMonthlyUnitPrice: PropType.number,
proMonthlyUnitPrice: PropType.number,
proYearlyUnitPrice: PropType.number,
}

function PlanUpgradePro({ isSentryUpgrade, plans }) {
const { proPlanMonth, proPlanYear } = findProPlans({ plans })
const { sentryPlanYear } = findSentryPlans({ plans })
const { proPlanMonth } = findProPlans({ plans })
const { sentryPlanMonth } = findSentryPlans({ plans })

const upgradeToPlan = isSentryUpgrade ? sentryPlanYear : proPlanMonth
const upgradeToPlan = isSentryUpgrade ? sentryPlanMonth : proPlanMonth

return (
<div className="flex flex-col border">
Expand All @@ -79,9 +75,8 @@ function PlanUpgradePro({ isSentryUpgrade, plans }) {
</p>
<PlanDetails
isSentryUpgrade={isSentryUpgrade}
sentryAnnualUnitPrice={sentryPlanYear?.baseUnitPrice}
sentryMonthlyUnitPrice={sentryPlanMonth?.baseUnitPrice}
proMonthlyUnitPrice={proPlanMonth?.baseUnitPrice}
proYearlyUnitPrice={proPlanYear?.baseUnitPrice}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const plansWithSentryOptions = [
marketingName: 'Sentry',
value: Plans.USERS_SENTRYM,
billingRate: null,
baseUnitPrice: 0,
baseUnitPrice: 12,
benefits: ['Includes 5 seats', 'Unlimited public repositories'],
monthlyUploadLimit: null,
},
Expand Down Expand Up @@ -168,7 +168,7 @@ describe('PlanUpgradePro', () => {
expect(benefitsList).toBeInTheDocument()
})

it('shows sentry price', async () => {
it('shows sentry up to 5 users price', async () => {
render(
<PlanUpgradePro isSentryUpgrade plans={plansWithSentryOptions} />,
{
Expand All @@ -180,15 +180,15 @@ describe('PlanUpgradePro', () => {
expect(sentryPrice).toBeInTheDocument()
})

it('shows sentry annual price', async () => {
it('shows sentry above 5 users price', async () => {
render(
<PlanUpgradePro isSentryUpgrade plans={plansWithSentryOptions} />,
{
wrapper,
}
)

const annualSentryPrice = await screen.findByText(/123/)
const annualSentryPrice = await screen.findByText(/12/)
expect(annualSentryPrice).toBeInTheDocument()
})

Expand Down Expand Up @@ -266,7 +266,7 @@ describe('PlanUpgradePro', () => {
expect(monthlyProPrice).toBeInTheDocument()
})

it('shows pro yearly price', async () => {
it('does not shows pro yearly price', async () => {
render(
<PlanUpgradePro
isSentryUpgrade={false}
Expand All @@ -277,8 +277,8 @@ describe('PlanUpgradePro', () => {
}
)

const yearlyProPrice = await screen.findByText(/456/)
expect(yearlyProPrice).toBeInTheDocument()
const yearlyProPrice = screen.queryByText(/456/)
expect(yearlyProPrice).not.toBeInTheDocument()
})

it('shows the actions billing component', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ function PlanUpgradeTeam() {
const currentPlan = planData?.plan
const { data: plans } = useAvailablePlans({ provider, owner })

const { teamPlanMonth, teamPlanYear } = findTeamPlans({
const { teamPlanMonth } = findTeamPlans({
plans,
})
const monthlyTeamBenefits = teamPlanMonth?.benefits
const monthlyMarketingName = teamPlanMonth?.marketingName
const monthlyUnitPrice = teamPlanMonth?.baseUnitPrice
const yearlyUnitPrice = teamPlanYear?.baseUnitPrice

let buttonText = 'Manage plan'
if (currentPlan?.isFreePlan || currentPlan?.isTrialPlan) {
Expand Down Expand Up @@ -65,12 +64,10 @@ function PlanUpgradeTeam() {
<p className="text-xs font-semibold">Pricing</p>
<div className="text-xs">
<p className="font-semibold">
<span className="text-2xl">${yearlyUnitPrice}</span> per
<span className="text-2xl">${monthlyUnitPrice}</span> per
user/month
</p>
<p className="text-ds-gray-senary">
billed annually, or ${monthlyUnitPrice} per user billing monthly
</p>
<p className="text-ds-gray-senary">billed monthly</p>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ describe('PlanUpgradeTeam', () => {
wrapper,
})

const yearlyPrice = await screen.findByText(/5/)
expect(yearlyPrice).toBeInTheDocument()
const yearlyPrice = screen.queryByText(/5/)
expect(yearlyPrice).not.toBeInTheDocument()

const monthlyPrice = await screen.findByText(/6/)
expect(monthlyPrice).toBeInTheDocument()

const auxiliaryText = await screen.findByText(/per user billing monthly/)
const auxiliaryText = await screen.findByText(/billed monthly/)
expect(auxiliaryText).toBeInTheDocument()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function ProPlanDetails() {
const { data: planData } = usePlanData({ provider, owner })
const { data: accountDetails } = useAccountDetails({ provider, owner })
const { data: plans } = useAvailablePlans({ provider, owner })
const { proPlanMonth, proPlanYear } = findProPlans({ plans })
const { proPlanMonth } = findProPlans({ plans })

const scheduledPhase = accountDetails?.scheduleDetail?.scheduledPhase

Expand All @@ -25,26 +25,23 @@ function ProPlanDetails() {

return (
<div className="h-fit border md:w-[280px]">
<h3 className="p-4 font-semibold">{proPlanYear?.marketingName} plan</h3>
<h3 className="p-4 font-semibold">{proPlanMonth?.marketingName} plan</h3>
<hr />
<div className="flex flex-col gap-6 p-4">
<div>
<p className="mb-2 text-xs font-semibold">Pricing</p>
<p className="text-xs font-semibold">
<span className="text-2xl">${proPlanYear?.baseUnitPrice}</span> per
<span className="text-2xl">${proPlanMonth?.baseUnitPrice}</span> per
user/month
</p>
<p className="text-xs text-ds-gray-senary">
billed annually, or ${proPlanMonth?.baseUnitPrice} for monthly
billing
</p>
<p className="text-xs text-ds-gray-senary">billed monthly</p>
</div>
<div>
<p className="mb-2 text-xs font-semibold">Includes</p>
<BenefitList
iconName="check"
iconColor="text-ds-pink-default"
benefits={proPlanYear?.benefits}
benefits={proPlanMonth?.benefits}
/>
</div>
{scheduledPhase && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ describe('ProPlanDetails', () => {
}

describe('when rendered', () => {
// we still support existing yearly plans
it('shows pro yearly marketing name', async () => {
setup({ isSentryPlan: false })
render(<ProPlanDetails />, { wrapper: wrapper() })
Expand All @@ -294,7 +295,7 @@ describe('ProPlanDetails', () => {

render(<ProPlanDetails />, { wrapper: wrapper() })

const price = await screen.findByText(/\$10/)
const price = await screen.findByText(/\$12/)
expect(price).toBeInTheDocument()
})

Expand All @@ -303,9 +304,7 @@ describe('ProPlanDetails', () => {

render(<ProPlanDetails />, { wrapper: wrapper() })

const disclaimer = await screen.findByText(
/billed annually, or \$12 for monthly billing/i
)
const disclaimer = await screen.findByText(/billed monthly/i)
expect(disclaimer).toBeInTheDocument()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ function SentryPlanDetails() {
const { data: accountDetails } = useAccountDetails({ provider, owner })
const { data: planData } = usePlanData({ provider, owner })
const { data: plans } = useAvailablePlans({ provider, owner })
const { sentryPlanYear } = findSentryPlans({ plans })
const { sentryPlanMonth } = findSentryPlans({ plans })

const cancelAtPeriodEnd =
accountDetails?.subscriptionDetail?.cancelAtPeriodEnd
const trialStatus = planData?.plan?.trialStatus
return (
<div className="h-fit border md:w-[280px]">
<h3 className="p-4 font-semibold">
{sentryPlanYear?.marketingName} plan
{sentryPlanMonth?.marketingName} plan
</h3>
<hr />
<div className="flex flex-col gap-6 p-4">
Expand All @@ -32,16 +32,16 @@ function SentryPlanDetails() {
<span className="text-2xl">${SENTRY_PRICE}</span>/month
</p>
<p className="text-xs text-ds-gray-senary">
over 5 users is ${sentryPlanYear?.baseUnitPrice} per user/month,
billed annually
over 5 users is ${sentryPlanMonth?.baseUnitPrice} per user/month,
billed monthly
</p>
</div>
<div>
<p className="mb-2 text-xs font-semibold">Includes</p>
<BenefitList
iconName="check"
iconColor="text-ds-pink-default"
benefits={sentryPlanYear?.benefits}
benefits={sentryPlanMonth?.benefits}
/>
</div>
{/* TODO_UPGRADE_FORM: Note that there never was schedules shown here like it is in the pro plan details page. This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ describe('SentryPlanDetails', () => {
}

describe('when rendered', () => {
// we still support existing yearly plans but no new ones
it('renders sentry pro yearly marketing name', async () => {
setup()
render(<SentryPlanDetails />, { wrapper: wrapper() })
Expand Down Expand Up @@ -264,7 +265,7 @@ describe('SentryPlanDetails', () => {
render(<SentryPlanDetails />, { wrapper: wrapper() })

const disclaimer = await screen.findByText(
/over 5 users is \$10 per user\/month, billed annually/i
/over 5 users is \$12 per user\/month, billed monthly/i
)
expect(disclaimer).toBeInTheDocument()
})
Expand Down
Loading
Loading