-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref: Migrate off isProPlan helper and onto GQL isProPlan #3599
Conversation
Bundle ReportChanges will decrease total bundle size by 684 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Bundle ReportChanges will decrease total bundle size by 684 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #3599 +/- ##
==========================================
+ Coverage 99.00% 99.01% +0.01%
==========================================
Files 810 810
Lines 14563 14548 -15
Branches 4151 4147 -4
==========================================
- Hits 14418 14405 -13
+ Misses 138 136 -2
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3599 +/- ##
==========================================
+ Coverage 99.00% 99.01% +0.01%
==========================================
Files 810 810
Lines 14563 14548 -15
Branches 4158 4154 -4
==========================================
- Hits 14418 14405 -13
+ Misses 138 136 -2
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3599 +/- ##
==========================================
+ Coverage 99.00% 99.01% +0.01%
==========================================
Files 810 810
Lines 14563 14548 -15
Branches 4151 4147 -4
==========================================
- Hits 14418 14405 -13
+ Misses 138 136 -2
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3599 +/- ##
==========================================
+ Coverage 99.00% 99.01% +0.01%
==========================================
Files 810 810
Lines 14563 14548 -15
Branches 4158 4147 -11
==========================================
- Hits 14418 14405 -13
+ Misses 138 136 -2
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
baseUnitPrice: 10, | ||
benefits: [], | ||
billingRate: BillingRate.MONTHLY, | ||
marketingName: 'Users Basic', | ||
monthlyUploadLimit: 250, | ||
value: Plans.USERS_BASIC, | ||
value: Plans.USERS_PR_INAPPM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm why did this value change from basic to pro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the original mock for this test was copy pasted from somewhere else, this is what the mock should've been to begin with
I only updated what I needed to tho admittedly
@@ -535,32 +488,3 @@ describe('isTrialPlan', () => { | |||
expect(isTrialPlan(Plans.USERS_BASIC)).toBeFalsy() | |||
}) | |||
}) | |||
|
|||
describe('isProPlan', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we adding the logic in these tests somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic now resides in API!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some q's, although would prefer Rola to leave her thoughts as well
@@ -34,24 +30,10 @@ export const BillingRate = { | |||
ANNUALLY: 'annually', | |||
} as const | |||
|
|||
export interface Plan { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source of truth for this schema is now the type in services/account
AUTOMATICALLY_CHARGED_METHOD: 'charge_automatically', | ||
}) | ||
|
||
export function useProPlans({ plans }: { plans?: IndividualPlan[] | null }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a copy of findProPlans below
@@ -82,26 +50,6 @@ export function isTrialPlan(plan?: PlanName | null) { | |||
return false | |||
} | |||
|
|||
export const CollectionMethods = Object.freeze({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just moving this up with the other exported consts for clarity in the file
@@ -159,6 +160,7 @@ describe('CancelPlanPage', () => { | |||
value: planValue, | |||
isEnterprisePlan: planValue === Plans.USERS_ENTERPRISEM, | |||
isFreePlan: planValue === Plans.USERS_BASIC, | |||
isProPlan: planValue === Plans.USERS_PR_INAPPM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USERS_PR_INAPPY doesn't matter here? Assuming it doesn't but wanted to ask just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nahhh it would tho if we had a test with USERS_PR_INAPPY
Description
This PR is a continuation of milestone 2 to remove all the gazebo helpers hardcoding business logic for is____Plan. In particular, this PR focused on isProPlan
Nothing abnormal, though I did see that one of the test suites wasn't actually calling a mock correctly which took a bit to figure out. Otherwise, this follows the pattern of the other migrations in the milestone (PRs linked on individual tickets).
There's another small update which is to clean up useProPlans, which is just a copy of findProPlans
Closes codecov/engineering-team#3003
Screenshots
Link to Sample Entry
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.