Skip to content

Commit 10d247c

Browse files
dante01yoonampagent
andcommitted
fix(billing): retain inactive local billing access
Amp-Thread-ID: https://ampcode.com/threads/T-019fc87c-d73e-7635-83db-1f7c0e65e42d Co-authored-by: Amp <amp@ampcode.com>
1 parent a978944 commit 10d247c

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,25 @@ describe('SubscriptionPanelContentWorkspace', () => {
651651
).toBeInTheDocument()
652652
})
653653

654+
it('preserves local inactive Team billing and invoice actions', async () => {
655+
const user = userEvent.setup()
656+
mockDistributionState.isCloud = false
657+
mockSubscriptionStatus.value = 'canceled'
658+
mockIsActiveSubscription.value = false
659+
mockIsWorkspaceSubscribed.value = false
660+
renderComponent()
661+
662+
expect(
663+
screen.getByRole('heading', { name: 'Inactive team subscription' })
664+
).toBeInTheDocument()
665+
await user.click(screen.getByRole('button', { name: 'Billing & invoices' }))
666+
expect(mockManageSubscription).toHaveBeenCalledOnce()
667+
expect(screen.getByTestId('subscription-footer-links')).toHaveAttribute(
668+
'data-show-invoice-history',
669+
'true'
670+
)
671+
})
672+
654673
it('renders an ended Team plan for its owner and routes reactivation to checkout', async () => {
655674
mockSubscriptionStatus.value = 'canceled'
656675
mockIsActiveSubscription.value = false

src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@
108108
</div>
109109
<div class="flex flex-wrap gap-2 md:ml-auto">
110110
<Button
111-
v-if="isCloud && permissions.canManageSubscription"
111+
v-if="
112+
permissions.canManageSubscription &&
113+
(isCloud || showInactiveTeamSubscription)
114+
"
112115
size="lg"
113116
variant="secondary"
114117
class="rounded-lg bg-interface-menu-component-surface-selected px-4 text-sm font-normal text-text-primary"

0 commit comments

Comments
 (0)