Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const primaryLabel = computed(() => {

const secondaryLabel = computed(() => {
return props.expressCheckoutEnabled
? 'Express checkout'
? 'Add to basket'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ticket requests to remove this text, not replace it:

Image

: 'Explore more options';
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<KvLightbox
title="Confirm Payment"
:title="lightboxTitle"
:visible="lightboxOpen"
:prevent-close="!ready || paying"
@lightbox-closed="closeLightbox"
Expand Down Expand Up @@ -45,7 +45,7 @@
class="tw-text-caption tw-mt-1 tw-mb-7 md:!tw-mb-2"
style="font-weight: 611;"
>
By clicking &ldquo;Confirm payment&rdquo; you will be funding this loan
By clicking &ldquo;Complete order&rdquo; you will be funding this loan
and we&rsquo;ll charge your payment method for the selected amount.
</p>

Expand Down Expand Up @@ -130,6 +130,8 @@ let clientTokenPromise = null;

const depositRequired = computed(() => (numeral(totalDue.value).value() ?? 0) > 0);

const lightboxTitle = computed(() => (ready.value ? 'Adding to basket' : 'Confirm payment'));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the opposite of what the ticket requests, it now says "Adding to basket" when the modal is completely loaded:

Image


const paymentButtonState = computed(() => {
if (depositRequired.value && !transactionsEnabled.value) {
return 'disabled';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ vi.mock('@kiva/kv-components', () => ({
},
KvLightbox: {
props: ['preventClose', 'title', 'visible'],
template: '<div v-if="visible" data-testid="lightbox" :data-prevent-close="preventClose"><slot /></div>',
// eslint-disable-next-line max-len
template: '<div v-if="visible" data-testid="lightbox" :data-prevent-close="preventClose">{{ title }}<slot /></div>',
},
KvLoadingPlaceholder: {
template: '<div data-testid="loading-placeholder"></div>',
Expand Down Expand Up @@ -187,6 +188,11 @@ describe('ExpressCheckoutModal', () => {
});
});

it('renders the card with correct heading', async () => {
await mountComponent();
expect(wrapper.text()).toContain('Adding to basket');
});

// executeOneTimeCheckout runs trackSuccess internally (kv-shop), which fires Meta Purchase + GA +
// Optimizely for this checkoutId. Tracking again here would double-count the Purchase.
it('does not track the transaction itself — kv-shop already did', async () => {
Expand Down Expand Up @@ -343,5 +349,13 @@ describe('ExpressCheckoutModal', () => {
expect(wrapper.find('[data-testid="express-checkout-loading"]').exists()).toBe(true);
expect(wrapper.find('form').exists()).toBe(false);
});

it('renders the card with correct heading while loading', async () => {
mountClosed();
wrapper.vm.openLoading();
await wrapper.vm.$nextTick();

expect(wrapper.text()).toContain('Confirm payment');
});
});
});
Loading