Skip to content

Commit 0b3b6c4

Browse files
dante01yoonampagent
andcommitted
test: cover past-due cancellation permissions
Amp-Thread-ID: https://ampcode.com/threads/T-01a001d5-47e3-720d-8e82-82c45995251e Co-authored-by: Amp <amp@ampcode.com>
1 parent df57e5b commit 0b3b6c4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/platform/workspace/composables/useWorkspaceMenuItems.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ describe('useWorkspaceMenuItems', () => {
140140
)
141141
})
142142

143+
it('withholds cancellation for payment_failed without lifecycle permission', () => {
144+
state.billingStatus = 'payment_failed'
145+
state.canManageSubscriptionLifecycle = false
146+
state.isActiveSubscription = false
147+
148+
const { menuItems } = useWorkspaceMenuItems()
149+
150+
expect(menuItems.value.map((item) => item.label)).not.toContain(
151+
'subscription.cancelPlan'
152+
)
153+
})
154+
143155
it('rechecks eligibility before opening the cancellation dialog', () => {
144156
state.canManageSubscriptionLifecycle = true
145157
const { menuItems } = useWorkspaceMenuItems()

0 commit comments

Comments
 (0)