Skip to content

Commit

Permalink
Merge branch 'moment-warning' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Dec 21, 2023
2 parents 9841c7d + 438cdd9 commit 788d1d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/analytics/analytics.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const analyticsFactory = /* @ngInject */ function ($window, $timeout, envService
cart.item[0].attributes.donationType = 'one-time donation'
} else {
cart.item[0].attributes.donationType = 'recurring donation'
recurringDate = moment(`${moment().year()}-${itemConfig.RECURRING_START_MONTH}-${itemConfig.RECURRING_DAY_OF_MONTH} ${moment().format('h:mm:ss a')}`)
recurringDate = moment(`${moment().year()}-${itemConfig.RECURRING_START_MONTH}-${itemConfig.RECURRING_DAY_OF_MONTH}`)
}

// Set donation frequency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ describe('PaymentMethodsComponent', function () {
expect($ctrl.profileService.getPaymentMethodsWithDonations).toHaveBeenCalled()
expect($ctrl.$log.error.logs[0]).toEqual(['Error loading payment methods', { data: 'some error' }])
})

it('should handle 500 errors differently when loading payment methods', () => {
jest.spyOn($ctrl.profileService, 'getPaymentMethodsWithDonations').mockReturnValue(Observable.throw({
status: 500
}))
$ctrl.loadPaymentMethods()

expect($ctrl.loadingError).toEqual('authentication')
})
})

describe('loadDonorDetails()', () => {
Expand Down

0 comments on commit 788d1d3

Please sign in to comment.