SSR-1067 Payment Page Cart Bug Fixes
Fixed Cart showing for non credit card payments Fixed remove option showing
This commit is contained in:
parent
478bf091ed
commit
e7bb76ff81
3 changed files with 45 additions and 4 deletions
|
|
@ -65,7 +65,7 @@
|
||||||
<div class="py-1 d-flex justify-content-between align-items-center">
|
<div class="py-1 d-flex justify-content-between align-items-center">
|
||||||
<span>{{ item?.name ?? '' }}</span>
|
<span>{{ item?.name ?? '' }}</span>
|
||||||
<textLink
|
<textLink
|
||||||
v-if="!readOnly || !showAsPaid"
|
v-if="!readOnly"
|
||||||
linkType="text"
|
linkType="text"
|
||||||
text="Remove"
|
text="Remove"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
</div>
|
</div>
|
||||||
<textLink
|
<textLink
|
||||||
v-if="item.cartItemType === cartItemType.VAP
|
v-if="item.cartItemType === cartItemType.VAP
|
||||||
&& (!readOnly || !showAsPaid)"
|
&& !readOnly"
|
||||||
linkType="text"
|
linkType="text"
|
||||||
text="Remove"
|
text="Remove"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { getMountOptions } from '@/helpers/unit-test-helper';
|
||||||
import { useMainStore } from '@/store';
|
import { useMainStore } from '@/store';
|
||||||
import { paymentMethods, hopPaymentMethods } from '@/constants/payment-method-constants.js';
|
import { paymentMethods, hopPaymentMethods } from '@/constants/payment-method-constants.js';
|
||||||
import queryStrings from '@/constants/query-strings';
|
import queryStrings from '@/constants/query-strings';
|
||||||
|
import CartDropdown from '@/iss-components/cart-dropdown/cart-dropdown.vue';
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const parts = {
|
const parts = {
|
||||||
|
|
@ -316,6 +317,44 @@ describe('payment-page.vue', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('cart-dropdown', () => {
|
||||||
|
test('Show cart dropdown if credit card', async () => {
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
wrapper.vm.paymentType = hopPaymentMethods.CREDIT_CARD;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await wrapper.vm.$nextTick();
|
||||||
|
const cartTable = wrapper.findComponent(CartDropdown);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(cartTable.exists()).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Hide cart dropdown if afterpay', async () => {
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
wrapper.vm.paymentType = hopPaymentMethods.AFTERPAY;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await wrapper.vm.$nextTick();
|
||||||
|
const cartTable = wrapper.findComponent(CartDropdown);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(cartTable.exists()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Hide cart dropdown if paypal', async () => {
|
||||||
|
const wrapper = setupMocks({});
|
||||||
|
wrapper.vm.paymentType = hopPaymentMethods.PAYPAL;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await wrapper.vm.$nextTick();
|
||||||
|
const cartTable = wrapper.findComponent(CartDropdown);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(cartTable.exists()).toBeFalsy();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('isPaypal', () => {
|
describe('isPaypal', () => {
|
||||||
test('Is responsive if initial data changes', async () => {
|
test('Is responsive if initial data changes', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,8 @@
|
||||||
@ForwardClicked="forwardButtonAction"
|
@ForwardClicked="forwardButtonAction"
|
||||||
@backClicked="backButtonAction" />
|
@backClicked="backButtonAction" />
|
||||||
|
|
||||||
<div class="px-2">
|
<div v-if="isCreditCard" class="px-2">
|
||||||
<cartDropdown
|
<cartDropdown
|
||||||
:showAsPaid="false"
|
|
||||||
:readOnly="true"
|
:readOnly="true"
|
||||||
:showDropdownHeader="false"
|
:showDropdownHeader="false"
|
||||||
:isInitiallyExpanded="true"
|
:isInitiallyExpanded="true"
|
||||||
|
|
@ -525,6 +524,9 @@ export default {
|
||||||
isPaypal() {
|
isPaypal() {
|
||||||
return this.paymentType === hopPaymentMethods.PAYPAL;
|
return this.paymentType === hopPaymentMethods.PAYPAL;
|
||||||
},
|
},
|
||||||
|
isCreditCard() {
|
||||||
|
return this.paymentType === hopPaymentMethods.CREDIT_CARD;
|
||||||
|
},
|
||||||
displayPayInAdvanceCreditCardAlert() {
|
displayPayInAdvanceCreditCardAlert() {
|
||||||
return this.displayPayInAdvanceAlert(paymentMethods.CREDIT_CARD);
|
return this.displayPayInAdvanceAlert(paymentMethods.CREDIT_CARD);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue