Skip to content

Commit d7433d3

Browse files
dante01yoonampagent
andcommitted
fix: address billing menu review feedback
Amp-Thread-ID: https://ampcode.com/threads/T-01a001d5-47e3-720d-8e82-82c45995251e Co-authored-by: Amp <amp@ampcode.com>
1 parent fb5ede9 commit d7433d3

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ describe('CurrentUserPopoverWorkspace', () => {
252252
).not.toBeInTheDocument()
253253
})
254254

255-
it.each(['payment_failed', 'paused'])(
255+
it.for(['payment_failed', 'paused'])(
256256
'keeps Manage plan available instead of Subscribe when billing is %s',
257257
(billingStatus) => {
258258
state.billingStatus = billingStatus
@@ -354,10 +354,13 @@ describe('CurrentUserPopoverWorkspace', () => {
354354
state.canManageSubscription = true
355355
const { emitted } = renderComponent(workspaceType)
356356

357-
const menuItem = screen.getByTestId('manage-plan-menu-item')
357+
const menuItem = screen.getByRole('button', {
358+
name: enMessages.subscription.managePlan
359+
})
358360
expect(menuItem).toHaveTextContent(enMessages.subscription.managePlan)
359361

360-
await user.click(menuItem)
362+
menuItem.focus()
363+
await user.keyboard('{Enter}')
361364

362365
expect(state.showSettingsDialog).toHaveBeenCalledWith('workspace')
363366
expect(emitted('close')).toHaveLength(1)

src/platform/workspace/components/CurrentUserPopoverWorkspace.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@
143143
}}</span>
144144
</div>
145145

146-
<div
146+
<button
147147
v-if="!accountActionsOnly && showManagePlan"
148+
type="button"
148149
class="flex cursor-pointer items-center gap-2 px-4 py-2 hover:bg-secondary-background-hover"
149150
data-testid="manage-plan-menu-item"
150151
@click="handleOpenPlanAndCreditsSettings"
@@ -153,7 +154,7 @@
153154
<span class="flex-1 text-sm text-base-foreground">{{
154155
$t('subscription.managePlan')
155156
}}</span>
156-
</div>
157+
</button>
157158

158159
<!-- Partner Nodes Pricing (always shown) -->
159160
<div

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('useWorkspaceMenuItems', () => {
116116
)
117117
})
118118

119-
it.each(['payment_failed', 'paused'])(
119+
it.for(['payment_failed', 'paused'])(
120120
'allows cancellation while a %s plan needs payment recovery',
121121
(billingStatus) => {
122122
state.billingStatus = billingStatus

0 commit comments

Comments
 (0)