-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d08fa57
commit 42b3e6f
Showing
20 changed files
with
4,584 additions
and
52 deletions.
There are no files selected for viewing
3,985 changes: 3,985 additions & 0 deletions
3,985
packages/blockchain-wallet-v4-frontend/src/assets/locales/defaultMessages.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...ages/blockchain-wallet-v4-frontend/src/data/components/identityVerification/sagas.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { expectSaga } from 'redux-saga-test-plan' | ||
|
||
import { Remote } from 'blockchain-wallet-v4/src' | ||
import * as A from './actions' | ||
import { FLOW_TYPES } from './model' | ||
import sagas, { wrongFlowTypeError } from './sagas' | ||
|
||
const api = { | ||
fetchKycConfig: jest.fn(), | ||
resendDeeplink: jest.fn() | ||
} | ||
|
||
const coreSagas = {} | ||
|
||
const { checkKycFlow } = sagas({ api, coreSagas }) | ||
|
||
describe('checkKycFlow saga', () => { | ||
it('should set flow type', () => { | ||
const flowType = FLOW_TYPES.LOW | ||
api.fetchKycConfig.mockResolvedValue({ flowType }) | ||
return expectSaga(checkKycFlow) | ||
.put(A.setKycFlow(Remote.Loading)) | ||
.call(api.fetchKycConfig) | ||
.put(A.setKycFlow(Remote.of(flowType))) | ||
.run() | ||
}) | ||
|
||
it('should set wrong type error if type is not in FLOW_TYPES', () => { | ||
const flowType = FLOW_TYPES.LOW + '1' | ||
api.fetchKycConfig.mockResolvedValue({ flowType }) | ||
return expectSaga(checkKycFlow) | ||
.put(A.setKycFlow(Remote.Loading)) | ||
.call(api.fetchKycConfig) | ||
.put(A.setKycFlow(Remote.Failure(wrongFlowTypeError))) | ||
.run() | ||
}) | ||
|
||
it('should set error if flow type endpoint rejects', () => { | ||
const error = {} | ||
api.fetchKycConfig.mockRejectedValue(error) | ||
return expectSaga(checkKycFlow) | ||
.put(A.setKycFlow(Remote.Loading)) | ||
.call(api.fetchKycConfig) | ||
.put(A.setKycFlow(Remote.Failure(error))) | ||
.run() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
.../modals/Exchange/IdentityVerification/Verify/__snapshots__/template.highflow.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`HighFlow should render correctly 1`] = ` | ||
<IdentityVerification__IdentityVerificationForm> | ||
<FooterShadowWrapper | ||
fields={ | ||
<templatehighflow__VerifyWrapper> | ||
<IdentityVerification__ColLeft> | ||
<IdentityVerification__InputWrapper> | ||
<IdentityVerification__IdentityVerificationHeader> | ||
<FormattedMessage | ||
defaultMessage="Last Step. Continue your verification on mobile" | ||
id="identityverification.highflow.header" | ||
values={Object {}} | ||
/> | ||
</IdentityVerification__IdentityVerificationHeader> | ||
<IdentityVerification__IdentityVerificationImage | ||
name="identity-verification" | ||
/> | ||
<IdentityVerification__IdentityVerificationSubHeader> | ||
<Text | ||
altFont={false} | ||
capitalize={false} | ||
color="gray-5" | ||
cursor="inherit" | ||
italic={false} | ||
opacity={1} | ||
size="16px" | ||
uppercase={false} | ||
weight={400} | ||
> | ||
<FormattedMessage | ||
defaultMessage="We need to confirm your identity by taking a selfie video" | ||
id="identityverification.highflow.message" | ||
values={Object {}} | ||
/> | ||
</Text> | ||
<br /> | ||
<Text | ||
altFont={false} | ||
capitalize={false} | ||
color="gray-5" | ||
cursor="inherit" | ||
italic={false} | ||
opacity={1} | ||
size="16px" | ||
uppercase={false} | ||
weight={400} | ||
> | ||
<FormattedMessage | ||
defaultMessage="- We just sent you an SMS to {mobile} with a link to complete KYC on your mobile device" | ||
id="identityverification.highflow.sentlink" | ||
values={ | ||
Object { | ||
"mobile": "1234567890", | ||
} | ||
} | ||
/> | ||
</Text> | ||
<Text | ||
altFont={false} | ||
capitalize={false} | ||
color="gray-5" | ||
cursor="inherit" | ||
italic={false} | ||
opacity={1} | ||
size="16px" | ||
uppercase={false} | ||
weight={400} | ||
> | ||
<FormattedMessage | ||
defaultMessage="- Get your ID or Passport ready" | ||
id="identityverification.highflow.getidready" | ||
values={Object {}} | ||
/> | ||
</Text> | ||
<br /> | ||
<Link | ||
bold={false} | ||
capitalize={false} | ||
color="brand-secondary" | ||
onClick={[MockFunction]} | ||
size="16px" | ||
uppercase={false} | ||
weight={400} | ||
> | ||
<FormattedMessage | ||
defaultMessage="Resend link" | ||
id="identityverification.highflow.resend" | ||
values={Object {}} | ||
/> | ||
</Link> | ||
</IdentityVerification__IdentityVerificationSubHeader> | ||
</IdentityVerification__InputWrapper> | ||
</IdentityVerification__ColLeft> | ||
</templatehighflow__VerifyWrapper> | ||
} | ||
footer={ | ||
<templatehighflow__Footer> | ||
<IdentityVerification__BackButton | ||
onClick={[MockFunction]} | ||
> | ||
<FormattedMessage | ||
defaultMessage="Back" | ||
id="identityverification.personal.back" | ||
values={Object {}} | ||
/> | ||
</IdentityVerification__BackButton> | ||
</templatehighflow__Footer> | ||
} | ||
/> | ||
</IdentityVerification__IdentityVerificationForm> | ||
`; |
Oops, something went wrong.