diff --git a/src/app/checkout/step-2/existingPaymentMethods/existingPaymentMethods.component.js b/src/app/checkout/step-2/existingPaymentMethods/existingPaymentMethods.component.js index ee8727bcd..b247cf9e0 100644 --- a/src/app/checkout/step-2/existingPaymentMethods/existingPaymentMethods.component.js +++ b/src/app/checkout/step-2/existingPaymentMethods/existingPaymentMethods.component.js @@ -156,7 +156,6 @@ class ExistingPaymentMethodsController { const selectedUri = this.selectedPaymentMethod.self.uri const storage = JSON.parse(this.sessionStorage.getItem('storedCvvs')) - // const storedUris = Object.keys(storage) const getSelectedCvv = storage ? storage[Object.keys(storage).filter((item) => item === selectedUri)] : false; if (getSelectedCvv) { diff --git a/src/app/checkout/step-2/existingPaymentMethods/existingPaymentMethods.component.spec.js b/src/app/checkout/step-2/existingPaymentMethods/existingPaymentMethods.component.spec.js index 339d4bae1..1827455a7 100644 --- a/src/app/checkout/step-2/existingPaymentMethods/existingPaymentMethods.component.spec.js +++ b/src/app/checkout/step-2/existingPaymentMethods/existingPaymentMethods.component.spec.js @@ -359,10 +359,8 @@ describe('checkout', () => { self.controller.creditCardPaymentForm.securityCode.$viewValue = '123' self.controller.selectedPaymentMethod = { 'card-type': 'Visa', self: { type: 'cru.creditcards.named-credit-card', uri: '/paymentmethods/crugive/giydsnjqgi=' }, selectAction: 'some uri' } self.$window.sessionStorage.setItem('storedCvvs', '{"/paymentmethods/crugive/giydsnjqgi=":"456","/paymentmethods/crugive/giydsnjqgy=":"321"}') - console.log(self.$window.sessionStorage) - // self.controller.sessionStorage.setItem('storedCvvs', JSON.stringify({ 'selected uri': '456' })) self.controller.switchPayment() - + expect(self.controller.creditCardPaymentForm.securityCode.$setViewValue).toHaveBeenCalledWith('456') expect(self.controller.creditCardPaymentForm.securityCode.$render).toHaveBeenCalled() })