Skip to content

Commit

Permalink
fix: Show enterprise plan card when usesInvoices true (#2779)
Browse files Browse the repository at this point in the history
* show enterprise plan card when usesInvoices true

* remove this consolelog

* remove symlink
  • Loading branch information
ajay-sentry authored Apr 17, 2024
1 parent 521a596 commit 795cf7b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ const enterprisePlan = {
},
}

const usesInvoiceTeamPlan = {
plan: {
marketingName: 'blah',
value: 'users-teamm',
billingRate: null,
baseUnitPrice: 0,
benefits: [
'Unlimited users',
'Unlimited public repositories',
'Unlimited private repositories',
],
},
usesInvoice: true,
}

const trialPlanDetails = {
plan: {
marketingName: 'Pro Trial Team',
Expand Down Expand Up @@ -141,5 +156,18 @@ describe('CurrentPlanCard', () => {
const enterpriseCard = await screen.findByText(/Enterprise plan card/)
expect(enterpriseCard).toBeInTheDocument()
})

it('renders enterprise plan card when usesInvoice True', async () => {
setup(usesInvoiceTeamPlan)

render(<CurrentPlanCard />, {
wrapper,
})

const usesInvoiceEnterprise = await screen.findByText(
/Enterprise plan card/
)
expect(usesInvoiceEnterprise).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function CurrentPlanCard() {

if (
isEnterprisePlan(plan?.value) ||
collectionMethod === CollectionMethods.INVOICED_CUSTOMER_METHOD
collectionMethod === CollectionMethods.INVOICED_CUSTOMER_METHOD ||
accountDetails?.usesInvoice
) {
return <EnterprisePlanCard plan={plan} />
}
Expand Down
1 change: 0 additions & 1 deletion src/services/user/useResyncUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export function useResyncUser() {
data?.length > 0 ? data[data.length - 1]?.pages?.repos?.length : 0

if (numRepos < PAGE_SIZE) {
console.log(data, numRepos)
queryClient.invalidateQueries({
queryKey: ['repos', provider, owner],
})
Expand Down

0 comments on commit 795cf7b

Please sign in to comment.