message: Add text coverage to payment.component
diff: @@ -64,7 +64,7 @@ describe('PaymentComponent', () => {
  basketService.applyCoupon.and.returnValue(of({}))
  dialog = jasmine.createSpyObj('MatDialog', ['open'])
  dialog.open.and.returnValue(null)
  - cookieService = jasmine.createSpyObj('CookieService', ['remove'])
  + cookieService = jasmine.createSpyObj('CookieService', ['remove', 'put'])
  walletService = jasmine.createSpyObj('AddressService', ['get', 'put'])
  walletService.get.and.returnValue(of({}))
  walletService.put.and.returnValue(of({}))
  @@ -136,6 +136,11 @@ describe('PaymentComponent', () => {
  expect(component.facebookUrl).toBeNull()
  })
  + it('should hold the default applicationName if not defined in configuration', () => {
  + configurationService.getApplicationConfiguration.and.returnValue(of({}))
  + expect(component.applicationName).toBe('OWASP Juice Shop')
  + })
  +
  it('should use custom twitter URL if configured', () => {
  configurationService.getApplicationConfiguration.and.returnValue(of({ application: { social: { twitterUrl: 'twitter' } } }))
  component.ngOnInit()
  @@ -308,4 +313,13 @@ describe('PaymentComponent', () => {
  component.choosePayment()
  expect(sessionStorage.removeItem).toHaveBeenCalledWith('walletTotal')
  })
  +
  + it('should add token to local storage and cookie on calling choosePayment in deluxe mode', () => {
  + component.mode = 'deluxe'
  + userService.upgradeToDeluxe.and.returnValue(of({ token: 'tokenValue' }))
  + spyOn(localStorage, 'setItem')
  + component.choosePayment()
  + expect(localStorage.setItem).toHaveBeenCalledWith('token', 'tokenValue')
  + expect(cookieService.put).toHaveBeenCalledWith('token', 'tokenValue')
  + })
  })
  