Merge pull request #24922 from overleaf/kh-add-customer-portal-links
[web] add stripe customer portal link GitOrigin-RevId: 6baaf51d4dd89ef779229ad17603529db06cf396
This commit is contained in:
@@ -531,9 +531,9 @@ describe('SubscriptionViewModelBuilder', function () {
|
||||
)
|
||||
assert.deepEqual(result.personalSubscription.payment, {
|
||||
taxRate: 0.1,
|
||||
billingDetailsLink: '/user/subscription/recurly/billing-details',
|
||||
billingDetailsLink: '/user/subscription/payment/billing-details',
|
||||
accountManagementLink:
|
||||
'/user/subscription/recurly/account-management',
|
||||
'/user/subscription/payment/account-management',
|
||||
additionalLicenses: 0,
|
||||
addOns: [
|
||||
{
|
||||
@@ -625,6 +625,35 @@ describe('SubscriptionViewModelBuilder', function () {
|
||||
12
|
||||
)
|
||||
})
|
||||
|
||||
it('does not add a billing details link for a Stripe subscription', async function () {
|
||||
this.paymentRecord.service = 'stripe'
|
||||
this.SubscriptionLocator.getUsersSubscription.yields(
|
||||
null,
|
||||
this.individualSubscription
|
||||
)
|
||||
this.Modules.hooks.fire
|
||||
.withArgs('getPaymentFromRecord', this.individualSubscription)
|
||||
.yields(null, [
|
||||
{
|
||||
subscription: this.paymentRecord,
|
||||
account: new PaymentProviderAccount({}),
|
||||
coupons: [],
|
||||
},
|
||||
])
|
||||
const result =
|
||||
await this.SubscriptionViewModelBuilder.promises.buildUsersSubscriptionViewModel(
|
||||
this.user
|
||||
)
|
||||
assert.equal(
|
||||
result.personalSubscription.payment.billingDetailsLink,
|
||||
undefined
|
||||
)
|
||||
assert.equal(
|
||||
result.personalSubscription.payment.accountManagementLink,
|
||||
'/user/subscription/payment/account-management'
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user