Skip to content

Commit

Permalink
merge and fix data
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-codecov committed Oct 31, 2023
1 parent aef0120 commit 3ece823
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function FreePlanCard({ plan, scheduledPhase }) {
let planValue = plan?.value
let baseUnitPrice = plan?.baseUnitPrice
let marketingName = plan?.marketingName

if (trialOngoing) {
benefits = planData?.pretrialPlan?.benefits
planValue = planData?.pretrialPlan?.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ const mockPlanData = {
trialEndDate: '',
trialTotalDays: 0,
pretrialUsersCount: 0,
planUserCount: 1,
}

const mockPreTrialPlanInfo = {
Expand Down Expand Up @@ -189,8 +190,8 @@ describe('FreePlanCard', () => {
plans,
trialStatus = TrialStatuses.CANNOT_TRIAL,
planValue = 'users-basic',
planUserCount = 1,
flagValue = false,
planUserCount = 1,
} = {
owner: {
username: 'codecov',
Expand Down Expand Up @@ -220,6 +221,7 @@ describe('FreePlanCard', () => {
...mockPlanData,
trialStatus,
value: planValue,
planUserCount,
},
pretrialPlan: mockPreTrialPlanInfo,
},
Expand Down Expand Up @@ -379,7 +381,6 @@ describe('FreePlanCard', () => {
planValue: 'users-trial',
trialStatus: TrialStatuses.ONGOING,
plans: allPlans,
planUserCount: 4,
flagValue: true,
})

Expand All @@ -396,7 +397,6 @@ describe('FreePlanCard', () => {
planValue: 'users-trial',
trialStatus: TrialStatuses.ONGOING,
plans: allPlans,
planUserCount: 4,
})

render(<FreePlanCard plan={freePlan} />, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function PlanUpgradeTeam() {
</div>
<div className="flex self-start">
<Button to={{ pageName: 'upgradeOrgPlan' }} variant="primary">
{isFreePlan(currentPlan?.planName)
{isFreePlan(currentPlan?.value)
? 'Upgrade to Team'
: 'Manage plan'}

Check warning on line 56 in src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx

View check run for this annotation

Codecov - Staging / codecov/patch

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx#L55-L56

Added lines #L55 - L56 were not covered by tests

Check warning on line 56 in src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx

View check run for this annotation

Codecov - QA / codecov/patch

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx#L55-L56

Added lines #L55 - L56 were not covered by tests

Check warning on line 56 in src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx

View check run for this annotation

Codecov Public QA / codecov/patch

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx#L55-L56

Added lines #L55 - L56 were not covered by tests

Check warning on line 56 in src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx

View check run for this annotation

Codecov / codecov/patch

src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx#L55-L56

Added lines #L55 - L56 were not covered by tests
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const mockPlanBasic = {
billingRate: 'monthly',
marketingName: 'Users Basic',
monthlyUploadLimit: 250,
planName: 'users-basic',
value: 'users-basic',
trialStatus: TrialStatuses.NOT_STARTED,
trialStartDate: '',
trialEndDate: '',
Expand All @@ -32,7 +32,7 @@ const mockPlanPro = {
billingRate: 'monthly',
marketingName: 'Pro',
monthlyUploadLimit: null,
planName: 'users-pr-inappm',
value: 'users-pr-inappm',
trialStatus: TrialStatuses.CANNOT_TRIAL,
trialStartDate: '',
trialEndDate: '',
Expand Down Expand Up @@ -130,7 +130,7 @@ const mockPreTrialPlanInfo = {
billingRate: 'monthly',
marketingName: 'Users Basic',
monthlyUploadLimit: 250,
planName: 'users-basic',
value: 'users-basic',
}

const server = setupServer()
Expand Down Expand Up @@ -199,7 +199,6 @@ describe('PlanUpgradeTeam', () => {
})

it('show the benefits list', async () => {
setup()
render(<PlanUpgradeTeam />, {
wrapper,
})
Expand Down
1 change: 0 additions & 1 deletion src/services/account/usePlanData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export const usePlanData = ({ provider, owner, opts }: UseTrialArgs) => {
},
}).then((res) => {
const parsedRes = PlanDataSchema?.safeParse(res?.data?.owner)

if (!parsedRes.success) {
return {}
}
Expand Down

0 comments on commit 3ece823

Please sign in to comment.