Skip to content

Commit

Permalink
test(Jumio): test initializeJumio saga
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Jul 22, 2018
1 parent 8b3f11e commit 4d084a4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ export default ({ coreSagas }) => {
submitSellQuote,
initializeJumio,
fetchJumioToken,
fetchJumioStatus,
completeJumio,
upload
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as sfoxActions from './actions.js'
import * as selectors from '../../selectors.js'
import sfoxSagas, { logLocation } from './sagas'
import * as C from 'services/AlertService'
import { promptForSecondPassword } from 'services/SagaService'
import { promptForSecondPassword, confirm } from 'services/SagaService'
import settings from 'config'

jest.mock('blockchain-wallet-v4/src/redux/sagas')
Expand Down Expand Up @@ -573,4 +573,28 @@ describe('sfoxSagas', () => {
})
})
})

describe('sfox initializeJumio', () => {
const { initializeJumio, fetchJumioStatus } = sfoxSagas({ coreSagas })

const saga = testSaga(initializeJumio)

it('should call fetchJumioStatus saga', () => {
saga.next().call(fetchJumioStatus)
})

it('should select bank accounts', () => {
saga.next('missing_token').select(selectors.core.data.sfox.getAccounts)
})

it('should prompt the user to confirm their id verification if missing_token and accounts', () => {
saga.next(Remote.of([{ id: 1 }])).call(confirm, {
title: 'verify_identity_title',
image: 'identity-verification',
message: 'verify_identity_msg',
confirm: 'confirm_verify_identity',
cancel: 'cancel_verify_identity'
})
})
})
})

0 comments on commit 4d084a4

Please sign in to comment.