Skip to content

Commit c87e433

Browse files
authored
ref: Migrate gazebo from isTrialPlan helper to GQL property (#3608)
1 parent aa4c740 commit c87e433

File tree

54 files changed

+94
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+94
-69
lines changed

src/pages/AccountSettings/AccountSettings.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ describe('AccountSettings', () => {
167167
isTeamPlan:
168168
planValue === Plans.USERS_TEAMM ||
169169
planValue === Plans.USERS_TEAMY,
170+
isTrialPlan: false,
170171
},
171172
},
172173
},

src/pages/AccountSettings/AccountSettingsSideMenu.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ describe('AccountSettingsSideMenu', () => {
155155
isTeamPlan:
156156
planValue === Plans.USERS_TEAMM ||
157157
planValue === Plans.USERS_TEAMY,
158+
isTrialPlan: false,
158159
},
159160
},
160161
},

src/pages/DefaultOrgSelector/DefaultOrgSelector.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ describe('DefaultOrgSelector', () => {
219219
isFreePlan: value === Plans.USERS_BASIC,
220220
isTeamPlan:
221221
value === Plans.USERS_TEAMM || value === Plans.USERS_TEAMY,
222+
isTrialPlan: value === Plans.USERS_TRIAL,
222223
trialStatus,
223224
value,
224225
},

src/pages/MembersPage/MembersActivation/Activation/Activation.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useParams } from 'react-router-dom'
22

33
import { TrialStatuses, useAccountDetails, usePlanData } from 'services/account'
4-
import { isTrialPlan } from 'shared/utils/billing'
54
import A from 'ui/A/A'
65

76
import ChangePlanLink from './ChangePlanLink'
@@ -19,7 +18,7 @@ function Activation() {
1918
const planQuantity = planData?.plan?.planUserCount || 0
2019

2120
if (
22-
isTrialPlan(planData?.plan?.value) &&
21+
planData?.plan?.isTrialPlan &&
2322
planData?.plan?.trialStatus === TrialStatuses.ONGOING
2423
) {
2524
return (

src/pages/MembersPage/MembersActivation/Activation/Activation.test.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const mockPlanData = {
3030
isFreePlan: true,
3131
isProPlan: false,
3232
isTeamPlan: false,
33+
isTrialPlan: false,
3334
baseUnitPrice: 10,
3435
benefits: [],
3536
billingRate: BillingRate.MONTHLY,
@@ -91,6 +92,7 @@ describe('Activation', () => {
9192
hasPrivateRepos: true,
9293
plan: {
9394
...mockPlanData,
95+
isTrialPlan: planValue === Plans.USERS_TRIAL,
9496
trialStatus,
9597
value: planValue,
9698
},
@@ -148,7 +150,7 @@ describe('Activation', () => {
148150

149151
describe('user is currently on a trial', () => {
150152
it('displays title', async () => {
151-
setup(mockedAccountDetails, TrialStatuses.ONGOING, 'users-trial')
153+
setup(mockedAccountDetails, TrialStatuses.ONGOING, Plans.USERS_TRIAL)
152154

153155
render(<Activation />, { wrapper: wrapper() })
154156

@@ -159,7 +161,7 @@ describe('Activation', () => {
159161
})
160162

161163
it('displays number of activated users', async () => {
162-
setup(mockedAccountDetails, TrialStatuses.ONGOING, 'users-trial')
164+
setup(mockedAccountDetails, TrialStatuses.ONGOING, Plans.USERS_TRIAL)
163165

164166
render(<Activation />, { wrapper: wrapper() })
165167

@@ -171,7 +173,7 @@ describe('Activation', () => {
171173
})
172174

173175
it('displays on trial notice', async () => {
174-
setup(mockedAccountDetails, TrialStatuses.ONGOING, 'users-trial')
176+
setup(mockedAccountDetails, TrialStatuses.ONGOING, Plans.USERS_TRIAL)
175177

176178
render(<Activation />, { wrapper: wrapper() })
177179

@@ -182,7 +184,7 @@ describe('Activation', () => {
182184
})
183185

184186
it('displays upgrade plan link', async () => {
185-
setup(mockedAccountDetails, TrialStatuses.ONGOING, 'users-trial')
187+
setup(mockedAccountDetails, TrialStatuses.ONGOING, Plans.USERS_TRIAL)
186188

187189
render(<Activation />, { wrapper: wrapper() })
188190

src/pages/MembersPage/MembersActivation/MembersActivation.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types'
33
import { useParams } from 'react-router-dom'
44

55
import { TrialStatuses, useAccountDetails, usePlanData } from 'services/account'
6-
import { isTrialPlan } from 'shared/utils/billing'
76

87
import Activation from './Activation'
98
import AutoActivate from './AutoActivate'
@@ -21,7 +20,7 @@ function MemberActivation() {
2120

2221
const showAutoActivate =
2322
!isUndefined(planAutoActivate) &&
24-
!isTrialPlan(planData?.plan?.value) &&
23+
!planData?.plan?.isTrialPlan &&
2524
planData?.plan?.trialStatus !== TrialStatuses.ONGOING
2625

2726
return (

src/pages/MembersPage/MembersActivation/MembersActivation.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const mockPlanData = {
4444
isFreePlan: false,
4545
isProPlan: false,
4646
isTeamPlan: false,
47+
isTrialPlan: false,
4748
}
4849

4950
const server = setupServer()

src/pages/MembersPage/MembersList/MembersList.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const mockActiveUserRequest = {
5353
const mockPlanData = {
5454
isEnterprisePlan: false,
5555
isProPlan: false,
56+
isTrialPlan: false,
5657
baseUnitPrice: 10,
5758
benefits: [],
5859
billingRate: 'monthly',

src/pages/MembersPage/MembersList/MembersTable/MembersTable.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const queryClient = new QueryClient({
9292
const mockPlanData = {
9393
isEnterprisePlan: false,
9494
isProPlan: false,
95+
isTrialPlan: false,
9596
baseUnitPrice: 10,
9697
benefits: [],
9798
billingRate: 'monthly',

src/pages/OwnerPage/HeaderBanners/ExceededUploadsAlert/ExceededUploadsAlert.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const mockPlanDataResponse = {
4141
isFreePlan: false,
4242
isProPlan: false,
4343
isTeamPlan: false,
44+
isTrialPlan: false,
4445
}
4546

4647
beforeAll(() => {

0 commit comments

Comments
 (0)