Skip to content

Commit

Permalink
cleanup tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
wjames111 committed Nov 25, 2024
1 parent 22c3206 commit aeccc63
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down

0 comments on commit aeccc63

Please sign in to comment.