diff --git a/src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.test.ts b/src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.test.ts
index 05c0e573cb7..528b97b2e02 100644
--- a/src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.test.ts
+++ b/src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.test.ts
@@ -398,17 +398,25 @@ describe('SubscriptionAddPaymentPreviewWorkspace', () => {
expect(screen.getByText('op-reconcile-123')).toBeTruthy()
})
- it('does not render a back action on the payment confirmation', () => {
- render(SubscriptionAddPaymentPreviewWorkspace, {
- props: { tierKey: 'creator', isLoading: true },
- global: globalOptions
+ it('owns a back action whether or not the payment element is embedded', async () => {
+ const { emitted } = render(SubscriptionAddPaymentPreviewWorkspace, {
+ props: { tierKey: 'creator' },
+ global: {
+ ...globalOptions,
+ stubs: {
+ ...globalOptions.stubs,
+ Button: {
+ props: ['ariaLabel'],
+ template:
+ ''
+ }
+ }
+ }
})
- expect(
- screen.queryByRole('button', {
- name: 'subscription.preview.backToAllPlans'
- })
- ).toBeNull()
+ await userEvent.click(screen.getByRole('button', { name: 'g.back' }))
+
+ expect(emitted().back).toBeTruthy()
})
it('prices a legacy preview from the server costs instead of rendering a blank total', () => {
diff --git a/src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue b/src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue
index 24acd5eb452..e82bb75cb06 100644
--- a/src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue
+++ b/src/platform/workspace/components/SubscriptionAddPaymentPreviewWorkspace.vue
@@ -27,7 +27,6 @@
:class="cn('mb-8 flex items-center gap-3', captureMode && 'xl:mb-10')"
>
-
+
diff --git a/src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.test.ts b/src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.test.ts
index a11b43911bf..5ab17c57843 100644
--- a/src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.test.ts
+++ b/src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.test.ts
@@ -63,6 +63,7 @@ const AddPaymentPreviewStub = {
Add Card
Apply promo
Invalidate quote
+ Back
`
}
@@ -209,11 +210,11 @@ describe('SubscriptionRequiredDialogContentWorkspace', () => {
expect(onClose).toHaveBeenCalledOnce()
})
- it('shows back button on preview step', () => {
+ it('leaves the back action to the preview step that renders its own', () => {
mockCheckoutStep.value = 'preview'
mockPreviewData.value = { transition_type: 'new_subscription' }
renderComponent()
- expect(screen.getByLabelText('Back')).toBeInTheDocument()
+ expect(screen.getAllByRole('button', { name: 'Back' })).toHaveLength(1)
})
it('shows insufficient credits message when reason is out_of_credits', () => {
@@ -283,7 +284,7 @@ describe('SubscriptionRequiredDialogContentWorkspace', () => {
mockPreviewData.value = { transition_type: 'new_subscription' }
renderComponent()
- await user.click(screen.getByLabelText('Back'))
+ await user.click(screen.getByRole('button', { name: 'Back' }))
expect(mockHandleBackToPricing).toHaveBeenCalled()
})
diff --git a/src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vue b/src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vue
index 9be5f65c6af..770cd410d32 100644
--- a/src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vue
+++ b/src/platform/workspace/components/SubscriptionRequiredDialogContentWorkspace.vue
@@ -2,18 +2,6 @@
-
-
-
-