@alphapoint/apex-web 5.5.5 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/App.js +30 -18
- package/lib/components/2FA/TwoFactorAuthContainer.js +58 -24
- package/lib/components/2FA/TwoFactorAuthContainer.test.js +215 -0
- package/lib/components/AccountsDropdown/AccountsDropdownComponent.css +6 -0
- package/lib/components/AccountsDropdown/AccountsDropdownComponent.js +6 -2
- package/lib/components/AccountsDropdown/AccountsDropdownComponent.test.js +43 -0
- package/lib/components/AccountsDropdown/AccountsDropdownContainer.js +3 -1
- package/lib/components/BalancesList/BalancesListContainer.js +4 -1
- package/lib/components/DepositSidePaneComponents/DepositFormComponent.js +2 -7
- package/lib/components/DigitalAssets/DigitalAssetsOfferingProfilePage.css +6 -3
- package/lib/components/DigitalAssets/DigitalAssetsOfferingProfilePage.js +2 -2
- package/lib/components/DigitalAssets/DigitalAssetsPage.js +1 -1
- package/lib/components/DigitalAssets/digitalAssetsPriceLabel.test.js +238 -0
- package/lib/components/EnableTwoFactorAuth/EnableTwoFactorAuthComponent.js +7 -0
- package/lib/components/EnableTwoFactorAuth/EnableTwoFactorAuthComponent.test.js +105 -0
- package/lib/components/EnableTwoFactorAuth/EnableTwoFactorAuthContainerFactory.js +12 -1
- package/lib/components/FusionAuth/ConfirmPendingWithdrawModal.js +60 -0
- package/lib/components/FusionAuth/FusionAuthCallbackComponent.js +66 -0
- package/lib/components/FusionAuth/FusionAuthCallbackContainer.js +24 -0
- package/lib/components/FusionAuth/FusionStepUpModal.js +63 -0
- package/lib/components/FusionAuth/LinkOAuthIdentityModal.css +6 -0
- package/lib/components/FusionAuth/LinkOAuthIdentityModal.js +65 -0
- package/lib/components/FuturesOrderBook/FuturesOrderBookContainer.js +6 -0
- package/lib/components/InstrumentPositions/InstrumentPositionsContainer.js +4 -1
- package/lib/components/KYC/kycLevelsVerificationPropsHelper.test.js +7 -8
- package/lib/components/Login/LoginFormComponent.js +15 -4
- package/lib/components/Login/LoginFormContainer.js +21 -26
- package/lib/components/MarginBalances/MarginDepositWithdraw/MarginDepositModal/MarginDepositFormContainer.js +2 -1
- package/lib/components/NoAccountBanner/NoAccountBanner.css +9 -0
- package/lib/components/NoAccountBanner/NoAccountBanner.js +58 -0
- package/lib/components/NoAccountBanner/index.js +16 -0
- package/lib/components/NoAccountPlaceholder/NoAccountPlaceholder.css +31 -0
- package/lib/components/NoAccountPlaceholder/NoAccountPlaceholder.js +33 -0
- package/lib/components/NoAccountPlaceholder/index.js +9 -0
- package/lib/components/OrderBookComponents/Level2DataTableComponent.js +4 -0
- package/lib/components/OrderBookComponents/OrderBookComponent.css +1 -0
- package/lib/components/OrderBookComponents/OrderBookComponent.js +7 -2
- package/lib/components/OrderBookComponents/OrderBookContainer.js +3 -1
- package/lib/components/OrderEntryComponents/defaultForm/BuySellTabs.js +11 -5
- package/lib/components/OrderEntryComponents/defaultForm/OrderEntryAnchoring.js +19 -3
- package/lib/components/OrderHistoryComponents/OpenOrders/OpenOrdersComponent.js +1 -1
- package/lib/components/OrderHistoryComponents/OpenOrders/OpenOrdersComponent.test.js +97 -73
- package/lib/components/PriceChart/TVChartComponent.js +47 -2
- package/lib/components/PriceChart/TVChartContainer.js +2 -1
- package/lib/components/Retail/RetailSidePanes/FiatDeposit/FiatDepositFormComponent.js +2 -6
- package/lib/components/Retail/RetailSidePanes/FiatWithdraw/FiatWithdrawFormComponent.js +2 -6
- package/lib/components/SendReceiveSidePane/ReceiveAddress/ReceiveAddressComponent.js +2 -6
- package/lib/components/SendReceiveSidePane/SendAddress/SendAddressComponent.js +2 -7
- package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/ProfileFormComponent.js +3 -1
- package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.css +10 -0
- package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.js +77 -0
- package/lib/components/Settings/ProfileAndSecurity/TwoFactorAuthSettingsCard/EnableTwoFactorAuth/EnableTwoFactorAuthComponent.js +12 -4
- package/lib/components/Settings/ProfileAndSecurity/TwoFactorAuthSettingsCard/EnableTwoFactorAuth/EnableTwoFactorAuthComponent.test.js +246 -0
- package/lib/components/Signup/SignupFormComponent.js +10 -1
- package/lib/components/Theme/ThemeToggler/ThemeToggler.js +4 -1
- package/lib/components/WithdrawSidePaneComponents/WithdrawForm/WithdrawFormComponent.js +3 -8
- package/lib/components/common/APRecaptcha/APRecaptcha.css +33 -0
- package/lib/components/common/APRecaptcha/APRecaptcha.js +252 -0
- package/lib/components/common/APRecaptcha/index.js +22 -0
- package/lib/components/common/ErrorBoundary/ErrorBoundary.css +35 -0
- package/lib/components/common/ErrorBoundary/ErrorBoundary.js +87 -0
- package/lib/config/configDefault.json +9 -2
- package/lib/helpers/accountProviderHelper.js +28 -0
- package/lib/helpers/accountProviderHelper.test.js +67 -0
- package/lib/helpers/dateHelper.test.js +11 -5
- package/lib/helpers/destinationTagHelper.test.js +14 -5
- package/lib/helpers/errorTextFormatter.js +13 -4
- package/lib/helpers/errorTextFormatter.test.js +26 -0
- package/lib/helpers/formValidations.test.js +19 -3
- package/lib/helpers/fusionStepUp.js +79 -0
- package/lib/helpers/fusionStepUp.test.js +136 -0
- package/lib/helpers/homePageLayoutHelper.test.js +16 -2
- package/lib/helpers/numberFormatter/numberFormatter.js +3 -1
- package/lib/helpers/numberFormatter/numberFormatter.test.js +9 -2
- package/lib/helpers/orderHelper.test.js +59 -38
- package/lib/helpers/placeOrderHelper.js +9 -2
- package/lib/helpers/placeOrderHelper.test.js +43 -16
- package/lib/helpers/recalculateOrderHelper.test.js +49 -12
- package/lib/helpers/safeSessionStorage.js +36 -0
- package/lib/helpers/twoFactorAuthCancellation.js +38 -0
- package/lib/helpers/wsHelper.test.js +16 -7
- package/lib/hocs/forAccount.js +33 -0
- package/lib/hocs/forAccount.test.js +50 -0
- package/lib/hocs/forVerified.js +16 -2
- package/lib/hocs/withAuthentication.js +3 -1
- package/lib/index.js +3 -2
- package/lib/layouts/HeaderLayout/HeaderLayout.js +2 -1
- package/lib/layouts/WalletsLayout/WalletsLayoutContainer.js +3 -1
- package/lib/layouts/WalletsLayout/WalletsLayoutContainer.test.js +84 -0
- package/lib/redux/actions/affiliateActions.test.js +22 -27
- package/lib/redux/actions/apiActions.js +25 -8
- package/lib/redux/actions/apiActions.test.js +98 -0
- package/lib/redux/actions/apiKeyActions.test.js +29 -34
- package/lib/redux/actions/authActions.js +581 -48
- package/lib/redux/actions/authActions.test.js +140 -164
- package/lib/redux/actions/confirmWithdrawActions.js +7 -2
- package/lib/redux/actions/confirmWithdrawActions.test.js +83 -29
- package/lib/redux/actions/depositActions.test.js +267 -249
- package/lib/redux/actions/eotcActions.test.js +3 -0
- package/lib/redux/actions/eotcSettlementActions.test.js +3 -0
- package/lib/redux/actions/eotcWithdrawActions.test.js +3 -0
- package/lib/redux/actions/fusionAuthActions.test.js +717 -0
- package/lib/redux/actions/instrumentActions.test.js +560 -160
- package/lib/redux/actions/interestAccountActions.js +12 -3
- package/lib/{components/MarginBalances/MarginDepositWithdraw/MarginDepositWithdrawContainer.notest.js → redux/actions/interestAccountActions.test.js} +41 -51
- package/lib/redux/actions/kycIdentityMindActions.js +4 -4
- package/lib/redux/actions/kycIdentityMindActions.test.js +31 -13
- package/lib/redux/actions/kycJumioActions.test.js +16 -6
- package/lib/redux/actions/kycManualActions.test.js +16 -9
- package/lib/redux/actions/level1Actions.test.js +2 -2
- package/lib/redux/actions/level2Actions.test.js +51 -120
- package/lib/redux/actions/loyaltyFeeActions.test.js +19 -16
- package/lib/redux/actions/marketStateUpdateActions.test.js +2 -2
- package/lib/redux/actions/modalActions.js +3 -0
- package/lib/redux/actions/orderEntryActions.js +32 -5
- package/lib/redux/actions/orderEntryActions.test.js +104 -37
- package/lib/redux/actions/orderHistoryActions.js +11 -4
- package/lib/redux/actions/orderHistoryActions.test.js +94 -79
- package/lib/redux/actions/positionActions.test.js +19 -4
- package/lib/redux/actions/productActions.test.js +38 -21
- package/lib/redux/actions/recentTradesActions.test.js +2 -2
- package/lib/redux/actions/regionFormActions.test.js +25 -33
- package/lib/redux/actions/reportActions.test.js +16 -35
- package/lib/redux/actions/signupActions.js +18 -4
- package/lib/redux/actions/signupActions.test.js +146 -142
- package/lib/redux/actions/snackbarActions.test.js +4 -4
- package/lib/redux/actions/tickersActions.test.js +10 -4
- package/lib/redux/actions/transferActions.test.js +111 -93
- package/lib/redux/actions/transferRequestActions.test.js +42 -42
- package/lib/redux/actions/userActions.js +97 -34
- package/lib/redux/actions/userActions.test.js +663 -314
- package/lib/redux/actions/verifyEmailActions.test.js +13 -2
- package/lib/redux/actions/withdrawActions.js +143 -76
- package/lib/redux/actions/withdrawActions.test.js +369 -187
- package/lib/redux/actions/withdrawActions.travelRule.test.js +17 -3
- package/lib/redux/actions/wsConnectionActions.js +96 -1
- package/lib/redux/actions/wsConnectionActions.test.js +9 -8
- package/lib/redux/actions/wsConnectionLifecycle.test.js +207 -0
- package/lib/redux/futures/actions/futuresOrderFormActions.js +26 -2
- package/lib/redux/margin/actions/marginActions.test.js +163 -75
- package/lib/redux/margin/actions/marginHistoryActions.test.js +190 -151
- package/lib/redux/margin/reducers/marginHistoryReducer.test.js +146 -135
- package/lib/redux/margin/selectors/marginHistorySelectors.test.js +101 -102
- package/lib/redux/margin/selectors/marginOrderSelectors.test.js +2 -2
- package/lib/redux/middlewares/authMiddleware.test.js +142 -23
- package/lib/redux/middlewares/placeOrderMiddleware.test.js +18 -1
- package/lib/redux/middlewares/startupMiddleware.test.js +10 -34
- package/lib/redux/middlewares/wsConnectionMiddleware.test.js +6 -1
- package/lib/redux/reducers/apiProcessingReducer.test.js +4 -2
- package/lib/redux/reducers/authReducer.test.js +3 -3
- package/lib/redux/reducers/depositReducer.test.js +2 -1
- package/lib/redux/reducers/level2Reducer.test.js +2 -2
- package/lib/redux/reducers/orderHistoryReducer.js +1 -1
- package/lib/redux/reducers/orderHistoryReducer.test.js +63 -75
- package/lib/redux/reducers/positionReducer.test.js +1 -2
- package/lib/redux/reducers/resetPasswordReducer.test.js +1 -0
- package/lib/redux/reducers/snackbarReducer.test.js +12 -39
- package/lib/redux/reducers/tickersReducer.test.js +2 -2
- package/lib/redux/reducers/userReducer.js +10 -0
- package/lib/redux/reducers/userReducer.test.js +36 -1
- package/lib/redux/reducers/withdrawReducer.test.js +11 -5
- package/lib/redux/selectors/buySellSelectors.test.js +10 -6
- package/lib/redux/selectors/depositWithdrawalSelectors.js +6 -12
- package/lib/redux/selectors/instrumentPositionSelectors.test.js +58 -18
- package/lib/redux/selectors/level2Selectors.test.js +60 -33
- package/lib/redux/selectors/loyaltyTokenSelectors.test.js +15 -13
- package/lib/redux/selectors/marginHistorySelectors.test.js +11 -5
- package/lib/redux/selectors/openOrdersActivitySelector.test.js +4 -4
- package/lib/redux/selectors/orderHistorySelectors.test.js +141 -22
- package/lib/redux/selectors/orderTotalSelector.test.js +76 -30
- package/lib/redux/selectors/productPositionSelectors.test.js +2 -1
- package/lib/redux/selectors/recentActivitySelector.js +8 -2
- package/lib/redux/selectors/recentActivitySelector.v2.test.js +33 -0
- package/lib/redux/selectors/recentTradesSelectors.test.js +17 -0
- package/lib/redux/selectors/transfersTableSelectors.test.js +7 -1
- package/lib/redux/selectors/userSelectors.js +6 -1
- package/lib/redux/selectors/userSelectors.test.js +28 -0
- package/lib/services/subscriptions/accountPositionSubscriptionService.test.js +0 -14
- package/lib/services/subscriptions/orderStateSubscriptionService.test.js +0 -14
- package/lib/services/subscriptions/orderTradesSuscriptionService.test.js +0 -14
- package/lib/services/tradingView/ChartAPI.js +17 -2
- package/lib/setupTests.js +1 -10
- package/package.json +21 -5
- package/lib/components/APSnackbar/APSnackbarContainer.notest.js +0 -58
- package/lib/components/ActivityReportingComponents/ActivityReportingButtons/ActivityReportingButtonsComponent.notest.js +0 -27
- package/lib/components/ActivityReportingComponents/ActivityReportingButtons/ActivityReportingButtonsContainer.notest.js +0 -42
- package/lib/components/AffiliateComponents/AffiliateActiveTagComponent.notest.js +0 -36
- package/lib/components/AffiliateComponents/AffiliateActiveTagContainer.notest.js +0 -81
- package/lib/components/AffiliateComponents/AffiliateCountContainer.notest.js +0 -37
- package/lib/components/AffiliateComponents/AffiliateModal.notest.js +0 -41
- package/lib/components/AffiliateComponents/AffiliateModalContainer.notest.js +0 -79
- package/lib/components/ApiKeysSidePaneComponents/ApiKeyList/ApiKeyListContainer.notest.js +0 -40
- package/lib/components/ApiKeysSidePaneComponents/ApiKeysComponent/ApiKeysComponent.notest.js +0 -32
- package/lib/components/ApiKeysSidePaneComponents/ApiKeysForm/ApiKeysFormComponent.notest.js +0 -32
- package/lib/components/ApiKeysSidePaneComponents/ApiKeysForm/ApiKeysFormContainer.notest.js +0 -29
- package/lib/components/ApiKeysSidePaneComponents/ApiKeysSidePane/ApiKeySidePaneComponent.notest.js +0 -46
- package/lib/components/ApiKeysSidePaneComponents/CreateApiKey/CreateApiKeyComponent.notest.js +0 -50
- package/lib/components/ApiKeysSidePaneComponents/CreateApiKey/CreateApiKeyContainer.notest.js +0 -70
- package/lib/components/ApiKeysSidePaneComponents/NewApiKey/NewApiKeyModalContainer.notest.js +0 -102
- package/lib/components/ApiKeysSidePaneComponents/RemoveApiKeyModal/RemoveApiKeyModalContainer.notest.js +0 -53
- package/lib/components/BalancesList/BalancesListContainer.notest.js +0 -91
- package/lib/components/BalancesMenu/BalanceMenuContainer.notest.js +0 -49
- package/lib/components/BalancesMenu/BalancesMenuComponent.notest.js +0 -68
- package/lib/components/BalancesMenu/BalancesMenuItemComponent.notest.js +0 -28
- package/lib/components/ConfirmBlockTradeModal/ConfirmBlockTradeModalContainer.notest.js +0 -171
- package/lib/components/ConfirmLimitOrderModal/ConfirmLimitOrderModalContainer.notest.js +0 -179
- package/lib/components/ConfirmWithdraw/ConfirmWithdrawContainer.notest.js +0 -58
- package/lib/components/DepositConfirmation/DepositConfirmationModalContainer.notest.js +0 -59
- package/lib/components/DepositSidePaneComponents/DepositFormComponent.notest.js +0 -123
- package/lib/components/DepositSidePaneComponents/DepositFormContainer.notest.js +0 -174
- package/lib/components/DepositSidePaneComponents/DepositTemplateFormComponent.notest.js +0 -79
- package/lib/components/DepositSidePaneComponents/DepositTemplateFormContainer.notest.js +0 -66
- package/lib/components/DepositSidePaneComponents/DepositWorkflows/CryptoWalletDepositWorkflow/CryptoWalletDepositWorkflowComponent.notest.js +0 -42
- package/lib/components/DepositSidePaneComponents/DepositWorkflows/CryptoWalletDepositWorkflow/CryptoWalletDepositWorkflowContainer.notest.js +0 -52
- package/lib/components/DepositSidePaneComponents/DepositWorkflows/DepositWorkflowsComponent.notest.js +0 -52
- package/lib/components/DepositSidePaneComponents/DepositWorkflows/DepositWorkflowsContainer.notest.js +0 -49
- package/lib/components/DepositSidePaneComponents/DepositWorkflows/GenericPaymentWorkflow/GenericPaymentWorkflowComponent.notest.js +0 -96
- package/lib/components/DepositSidePaneComponents/DepositWorkflows/GenericPaymentWorkflow/GenericPaymentWorkflowContainer.notest.js +0 -49
- package/lib/components/DepositSidePaneComponents/DepositWorkflows/ManualDepositWorkflow/ManualDepositWorkflowComponent.notest.js +0 -68
- package/lib/components/DepositSidePaneComponents/DepositWorkflows/ManualDepositWorkflow/ManualDepositWorkflowContainer.notest.js +0 -60
- package/lib/components/DepositSidePaneComponents/DepositWorkflows/PaymentProcessors/Hyphen/HyphenDepositWorkflowContainer.notest.js +0 -66
- package/lib/components/DepthChart/DepthChartContainer.notest.js +0 -82
- package/lib/components/EnableTwoFactorAuth/Disable2FAModalContainer.notest.js +0 -73
- package/lib/components/EnableTwoFactorAuth/Enable2FAModalContainer.notest.js +0 -82
- package/lib/components/EnableTwoFactorAuth/EnableTwoFactorAuthContainerFactory.notest.js +0 -50
- package/lib/components/EotcBalancesList/EotcBalancesListContainer.notest.js +0 -53
- package/lib/components/EotcProductCard/EotcProductCardContainer.notest.js +0 -87
- package/lib/components/EotcProductCard/EotcProductCardListContainer.notest.js +0 -55
- package/lib/components/EotcProductCardSimple/EotcProductCardSimpleContainer.notest.js +0 -136
- package/lib/components/EotcProductCardSimple/EotcProductCardSimpleListContainer.notest.js +0 -66
- package/lib/components/EotcWalletCard/EotcWalletCardContainer.notest.js +0 -148
- package/lib/components/EotcWalletCard/EotcWalletCardGridContainer.notest.js +0 -57
- package/lib/components/InstrumentPositions/InstrumentPositionsContainer.notest.js +0 -54
- package/lib/components/InstrumentPositionsWrapper/InstrumentPositionsWrapperContainer.notest.js +0 -46
- package/lib/components/InstrumentSelector/InstrumentSelectorContainer.notest.js +0 -112
- package/lib/components/InstrumentTable/InstrumentTableContainer.notest.js +0 -51
- package/lib/components/KYC/KYCBaseContainer.notest.js +0 -103
- package/lib/components/KYC/KYCLevel/KYCLevelComponent.notest.js +0 -94
- package/lib/components/KYCSettings/KYCSettingsContainer.notest.js +0 -49
- package/lib/components/KYCStatus/KYCStatusContainer.notest.js +0 -66
- package/lib/components/KYC_IM/KYC_IMForm/KYC_IMFormContainer.notest.js +0 -89
- package/lib/components/KYC_IM/KYC_IMForm/KYC_IMFormStepContainer.notest.js +0 -37
- package/lib/components/KYC_IM/KYC_IMLevelsContainer.notest.js +0 -47
- package/lib/components/KYC_IMLegacy/KYC_IMLegacyForm/KYC_IMLegacyFormContainer.notest.js +0 -152
- package/lib/components/KYC_IMLegacy/KYC_IMLegacyLevelsContainer.notest.js +0 -47
- package/lib/components/KYC_Jumio/KYC_JumioIframe/KYC_JumioIframeComponent.notest.js +0 -63
- package/lib/components/KYC_Jumio/KYC_JumioIframe/KYC_JumioIframeContainer.notest.js +0 -70
- package/lib/components/KYC_Jumio/KYC_JumioLevelsContainer.notest.js +0 -47
- package/lib/components/KYC_Manual/KYC_ManualForm/KYC_ManualFormContainer.notest.js +0 -102
- package/lib/components/KYC_Manual/KYC_ManualIframe/KYC_ManualIframeContainer.notest.js +0 -150
- package/lib/components/KYC_Manual/KYC_ManualLevelsContainer.notest.js +0 -47
- package/lib/components/Login/LoginFormComponent.notest.js +0 -84
- package/lib/components/Login/LoginFormContainer.notest.js +0 -111
- package/lib/components/LoyaltyToken/LoyaltyTokenContainer.notest.js +0 -57
- package/lib/components/MarginBalances/MarginDepositWithdraw/MarginDepositModal/MarginDepositFormContainer.notest.js +0 -87
- package/lib/components/MarginBalances/MarginOverview/MarginOverviewContainer.notest.js +0 -45
- package/lib/components/MarginTransferAssetModal/MarginTransferAssetsFormContainer.notest.js +0 -194
- package/lib/components/MarketDataCardsComponent/MarketDataCardsContainer.notest.js +0 -63
- package/lib/components/MenuItem/MenuItemComponent.notest.js +0 -39
- package/lib/components/OrderBookComponents/BulkCancelButtonsComponent/BulkCancelButtonsComponent.notest.js +0 -54
- package/lib/components/OrderBookComponents/Level2DataTableComponent.notest.js +0 -38
- package/lib/components/OrderBookComponents/OrderBookComponent.notest.js +0 -38
- package/lib/components/OrderBookComponents/OrderBookContainer.notest.js +0 -121
- package/lib/components/OrderHistoryComponents/DepositsStatus/DepositsStatusComponent.notest.js +0 -68
- package/lib/components/OrderHistoryComponents/FilledOrders/FilledOrdersComponent.notest.js +0 -156
- package/lib/components/OrderHistoryComponents/HeaderWithFilter/HeaderWithFilterContainer.notest.js +0 -58
- package/lib/components/OrderHistoryComponents/InactiveOrders/InactiveOrdersComponent.notest.js +0 -97
- package/lib/components/OrderHistoryComponents/MarginOpenPositions/MarginOpenPositionsComponent.notest.js +0 -93
- package/lib/components/OrderHistoryComponents/MarginOrderHistory/MarginOrderHistoryComponent.notest.js +0 -107
- package/lib/components/OrderHistoryComponents/MarginOrderHistoryExtended/MarginOrderHistoryExtendedComponent.notest.js +0 -118
- package/lib/components/OrderHistoryComponents/OpenOrders/OpenOrdersComponent.notest.js +0 -123
- package/lib/components/OrderHistoryComponents/OrderHistoryComponent.notest.js +0 -107
- package/lib/components/OrderHistoryComponents/PositionPayments/PositionPaymentsComponent.notest.js +0 -82
- package/lib/components/OrderHistoryComponents/TradeReports/TradeReportsComponent.notest.js +0 -124
- package/lib/components/OrderHistoryComponents/WithdrawStatus/WithdrawStatusComponent.notest.js +0 -69
- package/lib/components/PriceChart/ApexChartComponent.notest.js +0 -48
- package/lib/components/PriceChart/ApexChartContainer.notest.js +0 -75
- package/lib/components/PriceChart/PriceChartContainer.notest.js +0 -37
- package/lib/components/PriceChart/TVChartContainer.notest.js +0 -106
- package/lib/components/ProblemLoggingIn/ProblemLoggingInFormContainer.notest.js +0 -81
- package/lib/components/ProductPositionDetails/ProductPositionDetailsComponent.notest.js +0 -37
- package/lib/components/ProductPositionDetails/ProductPositionDetailsContainer.notest.js +0 -47
- package/lib/components/ProfileForm/ProfileFormComponent.notest.js +0 -51
- package/lib/components/ProfileForm/ProfileFormContainer.notest.js +0 -68
- package/lib/components/RecentActivity/RecentActivityContainer.notest.js +0 -41
- package/lib/components/RecentActivity/RecentActivityTable/RecentActivityTableContainer.notest.js +0 -43
- package/lib/components/RecentActivityWithFilter/RecentActivityHeaderWithFilter/RecentActivityHeaderForm/RecentActivityHeaderFormContainer.notest.js +0 -128
- package/lib/components/RecentActivityWithFilter/RecentActivityTableWithFilter/RecentActivityTableWithFilterContainer.notest.js +0 -64
- package/lib/components/RecentActivityWithFilter/RecentActivityWithFilterContainer.notest.js +0 -41
- package/lib/components/RecentTrades/RecentTradesComponent.notest.js +0 -78
- package/lib/components/RecentTrades/RecentTradesContainer.notest.js +0 -59
- package/lib/components/ReportBlockTradeSidePaneComponents/ReportBlockTradeContainer.notest.js +0 -169
- package/lib/components/ReportBlockTradeSidePaneComponents/ReportBlockTradeSidePaneContainer.notest.js +0 -107
- package/lib/components/ReportSidePaneComponents/ConfirmCyclicalReport/ConfirmCyclicalReportModalContainer.notest.js +0 -39
- package/lib/components/ReportSidePaneComponents/ConfirmSingleReport/ConfirmSingleReportModalContainer.notest.js +0 -39
- package/lib/components/ReportSidePaneComponents/CreateReportForm/CreateReportFormComponent.notest.js +0 -42
- package/lib/components/ReportSidePaneComponents/CreateReportForm/CreateReportFormContainer.notest.js +0 -85
- package/lib/components/ReportSidePaneComponents/DownloadReportForm/DownloadReportContainer.notest.js +0 -37
- package/lib/components/ReportSidePaneComponents/ReportSidePaneComponent.notest.js +0 -72
- package/lib/components/ReportSidePaneComponents/ScheduleReportForm/ScheduleReportFormComponent.notest.js +0 -43
- package/lib/components/ReportSidePaneComponents/ScheduleReportForm/ScheduleReportFormContainer.notest.js +0 -80
- package/lib/components/ReportSidePaneComponents/ScheduledReportsTable/ScheduledReportsTableComponent.notest.js +0 -34
- package/lib/components/ReportSidePaneComponents/ScheduledReportsTable/ScheduledReportsTableContainer.notest.js +0 -48
- package/lib/components/ResetPasswordForm/ResetPasswordFormContainer.notest.js +0 -105
- package/lib/components/ResetPasswordRequestForm/ResetPasswordRequestFormComponent.notest.js +0 -39
- package/lib/components/ResetPasswordRequestForm/ResetPasswordRequestFormContainerFactory.notest.js +0 -47
- package/lib/components/Retail/RetailBuySell/BuySell/BuySellContainer.notest.js +0 -105
- package/lib/components/Retail/RetailBuySell/BuySell/BuySellCustomRow/BuySellCustomRowContainer.notest.js +0 -145
- package/lib/components/Retail/RetailBuySell/BuySell/BuySellInstrumentSelector/BuySellInstrumentSelectorContainer.notest.js +0 -113
- package/lib/components/Retail/RetailBuySell/BuySell/BuySellOrderButton/BuySellOrderButtonContainer.notest.js +0 -66
- package/lib/components/Retail/RetailBuySell/BuySell/BuySellPresetValuesRows/BuySellPresetValuesRowsContainer.notest.js +0 -125
- package/lib/components/Retail/RetailBuySell/BuySell/BuySellTabs/BuySellTabsContainer.notest.js +0 -115
- package/lib/components/Retail/RetailBuySell/BuySellBalances/BuySellBalancesContainer.notest.js +0 -126
- package/lib/components/Retail/RetailBuySell/BuySellChartIntervalSelector/BuySellChartIntervalSelectorContainer.notest.js +0 -36
- package/lib/components/Retail/RetailBuySell/BuySellChartOverview/BuySellChartOverviewContainer.notest.js +0 -43
- package/lib/components/Retail/RetailBuySell/BuySellInstrumentSelect/BuySellInstrumentSelectContainer.notest.js +0 -153
- package/lib/components/Retail/RetailBuySell/BuySellOrderConfirmationModal/BuySellConfirmationModalContainer.notest.js +0 -262
- package/lib/components/Retail/RetailBuySell/BuySellOrderOverview/BuySellOrderOverviewContainer.notest.js +0 -124
- package/lib/components/Retail/RetailBuySell/EotcBuySell/EotcBuySellContainer.notest.js +0 -125
- package/lib/components/Retail/RetailBuySell/EotcBuySell/EotcBuySellCustomRow/EotcBuySellCustomRowContainer.notest.js +0 -143
- package/lib/components/Retail/RetailBuySell/EotcBuySell/EotcBuySellPresetValuesRows/EotcBuySellPresetValuesRowsContainer.notest.js +0 -125
- package/lib/components/Retail/RetailBuySell/EotcBuySellChartOverviewContainer/BuySellChartOverviewContainer.notest.js +0 -43
- package/lib/components/Retail/RetailBuySell/EotcBuySellOrderConfirmationModal/EotcBuySellConfirmationModalContainer.notest.js +0 -262
- package/lib/components/Retail/RetailSidePanes/FiatDeposit/DepositReferenceIdModalContainer.notest.js +0 -45
- package/lib/components/Retail/RetailSidePanes/FiatDeposit/FiatDepositFormContainer.notest.js +0 -137
- package/lib/components/Retail/RetailSidePanes/FiatDeposit/FiatDepositModalContainer.notest.js +0 -82
- package/lib/components/Retail/RetailSidePanes/FiatFormTabsComponent.notest.js +0 -49
- package/lib/components/Retail/RetailSidePanes/FiatSidePaneContainer.notest.js +0 -62
- package/lib/components/Retail/RetailSidePanes/FiatWithdraw/BankSelect/BankSelectContainer.notest.js +0 -80
- package/lib/components/Retail/RetailSidePanes/FiatWithdraw/FiatWithdrawFormContainer.notest.js +0 -124
- package/lib/components/Retail/RetailSidePanes/FiatWithdraw/FiatWithdrawModalContainer.notest.js +0 -46
- package/lib/components/SendReceiveSidePane/Receive/ReceiveContainer.notest.js +0 -69
- package/lib/components/SendReceiveSidePane/ReceiveAddress/ReceiveAddressContainer.notest.js +0 -73
- package/lib/components/SendReceiveSidePane/ReceiveForm/ReceiveFormContainer.notest.js +0 -54
- package/lib/components/SendReceiveSidePane/SendAddress/SendAddressContainer.notest.js +0 -71
- package/lib/components/SendReceiveSidePane/SendForm/SendFormContainer.notest.js +0 -72
- package/lib/components/SendReceiveSidePane/SendReceiveSidePaneContainer.notest.js +0 -139
- package/lib/components/SendReceiveSidePane/SendReceiveTwoFactorAuth/SendReceiveTwoFactorAuthContainer.notest.js +0 -102
- package/lib/components/Settings/ApiKeys/ApiKeysSidePaneButton/ApiKeysSidePaneButtonContainer.notest.js +0 -31
- package/lib/components/Settings/DemoSettings/DemoSettingsContainer.notest.js +0 -46
- package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/ProfileFormContainer.notest.js +0 -69
- package/lib/components/Settings/ProfileAndSecurity/RegionSettingsCard/RegionSettings/RegionSettingsContainer.notest.js +0 -86
- package/lib/components/Settings/ProfileAndSecurity/ThemeSettingsCard/ThemeForm/ThemeSettingsContainer.notest.js +0 -45
- package/lib/components/Settings/TradeSettings/MarginTrading/EnableMarginModal/EnableMarginConfirmationModalComponent.notest.js +0 -47
- package/lib/components/Settings/TradeSettings/MarginTrading/EnableMarginModal/EnableMarginConfirmationModalContainer.notest.js +0 -112
- package/lib/components/Settings/TradeSettings/MarginTrading/MarginTradingComponent.notest.js +0 -33
- package/lib/components/Settings/TradeSettings/MarginTrading/MarginTradingContainer.notest.js +0 -54
- package/lib/components/Settings/TransferHistory/TransferHistoryContainer.notest.js +0 -42
- package/lib/components/Signup/SignupFormComponent.notest.js +0 -92
- package/lib/components/Signup/SignupFormContainer.notest.js +0 -124
- package/lib/components/StandaloneKYC/StandaloneKYCContainer.notest.js +0 -75
- package/lib/components/StandaloneModal/StandaloneModalComponent.notest.js +0 -69
- package/lib/components/Ticker/TickerContainer.notest.js +0 -57
- package/lib/components/Transfers/TransfersContainer.notest.js +0 -99
- package/lib/components/Transfers/TransfersFilters/TransfersFiltersContainer.notest.js +0 -81
- package/lib/components/TwoFactorAuthForm/TwoFactorAuthFormContainer.notest.js +0 -60
- package/lib/components/UserBalance/UserBalanceContainer.notest.js +0 -47
- package/lib/components/UserSettings/UserSettingsComponent.notest.js +0 -55
- package/lib/components/UserSummary/UserSummaryContainer.notest.js +0 -65
- package/lib/components/VerificationRequired/VerificationRequiredContainer.notest.js +0 -47
- package/lib/components/VerifyEmail/VerifyEmailContainer.notest.js +0 -46
- package/lib/components/WalletCards/WalletCardContainer.notest.js +0 -77
- package/lib/components/WalletCards/WalletCardGridContainer.notest.js +0 -42
- package/lib/components/WalletDetails/WalletDetailsContainer.notest.js +0 -61
- package/lib/components/WalletNavItems/CryptoNavItemsContainer.notest.js +0 -46
- package/lib/components/WalletNavItems/EotcCryptoNavItemsContainer.notest.js +0 -64
- package/lib/components/WalletNavItems/FiatNavItemsComponent.notest.js +0 -59
- package/lib/components/WalletNavItems/FiatNavItemsContainer.notest.js +0 -66
- package/lib/components/WalletRows/WalletRowContainer.notest.js +0 -76
- package/lib/components/WalletRows/WalletRowListContainer.notest.js +0 -43
- package/lib/components/WithdrawSidePaneComponents/PaymentProcessors/HyphenWithdrawWorkflowContainer.notest.js +0 -51
- package/lib/components/WithdrawSidePaneComponents/PaymentProcessors/TrustpayWithdrawWorkflowContainer.notest.js +0 -36
- package/lib/components/WithdrawSidePaneComponents/WithdrawForm/WithdrawFormComponent.notest.js +0 -131
- package/lib/components/WithdrawSidePaneComponents/WithdrawForm/WithdrawFormContainer.notest.js +0 -140
- package/lib/components/WithdrawSidePaneComponents/WithdrawTemplateForm/WithdrawTemplateFormComponent.notest.js +0 -38
- package/lib/components/WithdrawSidePaneComponents/WithdrawTemplateForm/WithdrawTemplateFormContainer.notest.js +0 -95
- package/lib/components/WithdrawSidePaneComponents/WithdrawWorkflows/WithdrawWorkflowsContainer.notest.js +0 -42
- package/lib/components/common/APDatePicker/APDatePicker.notest.js +0 -194
- package/lib/components/common/APLabelWithText/APLabelWithText.notest.js +0 -25
- package/lib/components/common/APNumberInput.notest.js +0 -173
- package/lib/components/common/APRadioTab/APRadioTab.notest.js +0 -69
- package/lib/components/common/APSegmentedButton/APSegmentedButton.notest.js +0 -55
- package/lib/components/common/APSnackbar/APSnackbar.notest.js +0 -107
- package/lib/components/common/APVerticalScroller/APVerticalScroller.notest.js +0 -172
- package/lib/components/common/Modal/Modal.notest.js +0 -55
- package/lib/components/common/Pagination/PaginationComponent.notest.js +0 -137
- package/lib/components/common/Pagination/PaginationContainer.notest.js +0 -47
- package/lib/components/common/Popover/Popover.notest.js +0 -137
- package/lib/components/common/ProductIcon/ProductIcon.notest.js +0 -76
- package/lib/components/common/ProductIcon/ProductIconContainer.notest.js +0 -38
- package/lib/components/common/SidePane/SidePaneComponent.notest.js +0 -48
- package/lib/components/common/SidePane/SidePaneContainer.notest.js +0 -54
- package/lib/components/common/Snackbar/Snackbar.notest.js +0 -51
- package/lib/components/common/Tab/Tab.notest.js +0 -68
- package/lib/helpers/formGeneratorHelper.notest.js +0 -203
- package/lib/helpers/formTemplateHelper.notest.js +0 -170
- package/lib/hocs/modalDecorator.notest.js +0 -74
- package/lib/hocs/redirectIfAuthorized.notest.js +0 -80
- package/lib/hocs/resize.notest.js +0 -37
- package/lib/layouts/HomePageLayout.notest.js +0 -65
- package/lib/redux/actions/languageActions.test.js +0 -105
- package/lib/redux/selectors/recentActivitySelector.test.js +0 -725
|
@@ -4,7 +4,7 @@ var _reduxMockStore = _interopRequireDefault(require("redux-mock-store"));
|
|
|
4
4
|
var _reduxThunk = _interopRequireDefault(require("redux-thunk"));
|
|
5
5
|
var actions = _interopRequireWildcard(require("./depositActions"));
|
|
6
6
|
var snackbarActions = _interopRequireWildcard(require("./snackbarActions"));
|
|
7
|
-
var
|
|
7
|
+
var apiActions = _interopRequireWildcard(require("./apiActions"));
|
|
8
8
|
var _config = _interopRequireDefault(require("../../config"));
|
|
9
9
|
var _depositSubscriptionService = _interopRequireDefault(require("../../services/subscriptions/depositSubscriptionService"));
|
|
10
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -40,32 +40,34 @@ jest.mock('../../services/subscriptions/depositSubscriptionService', function ()
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
|
|
44
|
+
// All RPC calls in depositActions.js now go through the shared `callAPI` helper instead of
|
|
45
|
+
// individually-named `apex.connection.<Method>` functions, so mock that (Pattern B). Return
|
|
46
|
+
// values are keyed by endpoint since a single thunk (e.g. fetchAllProductDepositTemplates) can
|
|
47
|
+
// chain calls to more than one endpoint.
|
|
48
|
+
jest.mock('./apiActions', function () {
|
|
49
|
+
var returnValues = {
|
|
50
|
+
GetDepositTickets: []
|
|
51
|
+
};
|
|
52
|
+
var shouldReject = false;
|
|
46
53
|
return {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
returnValue = value;
|
|
65
|
-
},
|
|
66
|
-
setRPCPromiseReturnValue: function setRPCPromiseReturnValue(value) {
|
|
67
|
-
returnRPCPromiseValue = value;
|
|
68
|
-
}
|
|
54
|
+
// shouldReject is one-shot: it only rejects the *next* call, so a single rejected call
|
|
55
|
+
// (e.g. simulating a failed GetDepositTemplateTypes) doesn't also poison a subsequent,
|
|
56
|
+
// unrelated chained call made by the thunk's own catch/fallback handling.
|
|
57
|
+
callAPI: jest.fn(function (endpoint) {
|
|
58
|
+
return function () {
|
|
59
|
+
if (shouldReject) {
|
|
60
|
+
shouldReject = false;
|
|
61
|
+
return Promise.reject(new Error('fail'));
|
|
62
|
+
}
|
|
63
|
+
return Promise.resolve(returnValues[endpoint]);
|
|
64
|
+
};
|
|
65
|
+
}),
|
|
66
|
+
setReturnValue: function setReturnValue(endpoint, value) {
|
|
67
|
+
returnValues[endpoint] = value;
|
|
68
|
+
},
|
|
69
|
+
setShouldReject: function setShouldReject(value) {
|
|
70
|
+
shouldReject = value;
|
|
69
71
|
}
|
|
70
72
|
};
|
|
71
73
|
});
|
|
@@ -115,18 +117,24 @@ describe('depositActions', function () {
|
|
|
115
117
|
store.clearActions();
|
|
116
118
|
});
|
|
117
119
|
describe('fetchAllProductDepositTemplates', function () {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
apiActions.setReturnValue('GetDepositTemplateTypes', {
|
|
121
|
+
result: true,
|
|
122
|
+
TemplateTypes: [{
|
|
123
|
+
AccountProviderId: 1,
|
|
124
|
+
TemplateName: 'Standard'
|
|
125
|
+
}]
|
|
126
|
+
});
|
|
127
|
+
beforeEach(function () {
|
|
128
|
+
jest.clearAllMocks();
|
|
129
|
+
apiActions.setShouldReject(false);
|
|
130
|
+
apiActions.setReturnValue('GetDepositTemplateTypes', {
|
|
120
131
|
result: true,
|
|
121
132
|
TemplateTypes: [{
|
|
122
133
|
AccountProviderId: 1,
|
|
123
134
|
TemplateName: 'Standard'
|
|
124
135
|
}]
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
beforeEach(function () {
|
|
128
|
-
jest.clearAllMocks();
|
|
129
|
-
_apex["default"].connection.setReturnValue({
|
|
136
|
+
});
|
|
137
|
+
apiActions.setReturnValue('GetDepositRequestInfoTemplate', {
|
|
130
138
|
result: true,
|
|
131
139
|
DepositInfo: '[]',
|
|
132
140
|
Template: {
|
|
@@ -150,9 +158,9 @@ describe('depositActions', function () {
|
|
|
150
158
|
}
|
|
151
159
|
});
|
|
152
160
|
});
|
|
153
|
-
it('should call
|
|
161
|
+
it('should call callAPI with expected params', function () {
|
|
154
162
|
store.dispatch(actions.fetchAllProductDepositTemplates(2));
|
|
155
|
-
expect(
|
|
163
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('GetDepositTemplateTypes', {
|
|
156
164
|
ProductId: 2,
|
|
157
165
|
OMSId: 1,
|
|
158
166
|
AccountId: 1
|
|
@@ -177,7 +185,7 @@ describe('depositActions', function () {
|
|
|
177
185
|
}
|
|
178
186
|
}, _callee);
|
|
179
187
|
})));
|
|
180
|
-
it('should
|
|
188
|
+
it('should dispatch FETCH_PRODUCT_DEPOSIT_TEMPLATE if only one template exists for product', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
181
189
|
return _regenerator().w(function (_context2) {
|
|
182
190
|
while (1) switch (_context2.n) {
|
|
183
191
|
case 0:
|
|
@@ -188,7 +196,7 @@ describe('depositActions', function () {
|
|
|
188
196
|
type: actions.FETCH_PRODUCT_DEPOSIT_TEMPLATE,
|
|
189
197
|
payload: {
|
|
190
198
|
product: 2,
|
|
191
|
-
|
|
199
|
+
AccountProviderId: 1
|
|
192
200
|
}
|
|
193
201
|
});
|
|
194
202
|
case 2:
|
|
@@ -196,125 +204,126 @@ describe('depositActions', function () {
|
|
|
196
204
|
}
|
|
197
205
|
}, _callee2);
|
|
198
206
|
})));
|
|
199
|
-
it('should call GetDepositRequestInfoTemplate if product is CryptoCurrency', function () {
|
|
200
|
-
store.dispatch(actions.fetchAllProductDepositTemplates(1));
|
|
201
|
-
expect(_apex["default"].connection.GetDepositRequestInfoTemplate).toHaveBeenCalled();
|
|
202
|
-
});
|
|
203
|
-
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATES_ERROR, " if no deposit templates are returned"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
207
|
+
it('should call GetDepositRequestInfoTemplate if product is CryptoCurrency', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
204
208
|
return _regenerator().w(function (_context3) {
|
|
205
209
|
while (1) switch (_context3.n) {
|
|
206
210
|
case 0:
|
|
207
|
-
_apex["default"].connection.setRPCPromiseReturnValue(Promise.resolve({
|
|
208
|
-
o: JSON.stringify({
|
|
209
|
-
result: true,
|
|
210
|
-
TemplateTypes: []
|
|
211
|
-
})
|
|
212
|
-
}));
|
|
213
211
|
_context3.n = 1;
|
|
214
|
-
return store.dispatch(actions.fetchAllProductDepositTemplates(
|
|
212
|
+
return store.dispatch(actions.fetchAllProductDepositTemplates(1));
|
|
215
213
|
case 1:
|
|
216
|
-
expect(
|
|
214
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('GetDepositRequestInfoTemplate', expect.any(Object));
|
|
217
215
|
case 2:
|
|
218
216
|
return _context3.a(2);
|
|
219
217
|
}
|
|
220
218
|
}, _callee3);
|
|
221
219
|
})));
|
|
222
|
-
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATES_ERROR, " if
|
|
220
|
+
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATES_ERROR, " if no deposit templates are returned"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
223
221
|
return _regenerator().w(function (_context4) {
|
|
224
222
|
while (1) switch (_context4.n) {
|
|
225
223
|
case 0:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
errormsg: 'Test error'
|
|
230
|
-
})
|
|
224
|
+
apiActions.setReturnValue('GetDepositTemplateTypes', {
|
|
225
|
+
result: true,
|
|
226
|
+
TemplateTypes: []
|
|
231
227
|
});
|
|
232
228
|
_context4.n = 1;
|
|
233
229
|
return store.dispatch(actions.fetchAllProductDepositTemplates(2));
|
|
234
230
|
case 1:
|
|
235
|
-
expect(store.getActions()[1]).toEqual(
|
|
236
|
-
type: actions.RECEIVE_DEPOSIT_TEMPLATES_ERROR,
|
|
237
|
-
payload: 'Test error'
|
|
238
|
-
});
|
|
231
|
+
expect(store.getActions()[1].type).toEqual(actions.RECEIVE_DEPOSIT_TEMPLATES_ERROR);
|
|
239
232
|
case 2:
|
|
240
233
|
return _context4.a(2);
|
|
241
234
|
}
|
|
242
235
|
}, _callee4);
|
|
243
236
|
})));
|
|
244
|
-
it("should
|
|
237
|
+
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATES_ERROR, " if response result is false"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
245
238
|
return _regenerator().w(function (_context5) {
|
|
246
239
|
while (1) switch (_context5.n) {
|
|
247
240
|
case 0:
|
|
248
|
-
|
|
241
|
+
apiActions.setReturnValue('GetDepositTemplateTypes', {
|
|
242
|
+
result: false,
|
|
243
|
+
errormsg: 'Test error'
|
|
244
|
+
});
|
|
249
245
|
_context5.n = 1;
|
|
250
246
|
return store.dispatch(actions.fetchAllProductDepositTemplates(2));
|
|
251
247
|
case 1:
|
|
252
|
-
expect(store.getActions()[1]
|
|
248
|
+
expect(store.getActions()[1]).toEqual({
|
|
249
|
+
type: actions.RECEIVE_DEPOSIT_TEMPLATES_ERROR,
|
|
250
|
+
payload: 'Test error'
|
|
251
|
+
});
|
|
253
252
|
case 2:
|
|
254
253
|
return _context5.a(2);
|
|
255
254
|
}
|
|
256
255
|
}, _callee5);
|
|
257
256
|
})));
|
|
257
|
+
it("should call fetchProductDepositTemplate if response is rejected", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
258
|
+
return _regenerator().w(function (_context6) {
|
|
259
|
+
while (1) switch (_context6.n) {
|
|
260
|
+
case 0:
|
|
261
|
+
apiActions.setShouldReject(true);
|
|
262
|
+
_context6.n = 1;
|
|
263
|
+
return store.dispatch(actions.fetchAllProductDepositTemplates(2));
|
|
264
|
+
case 1:
|
|
265
|
+
expect(store.getActions()[1].type).toEqual(actions.FETCH_PRODUCT_DEPOSIT_TEMPLATE);
|
|
266
|
+
case 2:
|
|
267
|
+
return _context6.a(2);
|
|
268
|
+
}
|
|
269
|
+
}, _callee6);
|
|
270
|
+
})));
|
|
258
271
|
});
|
|
259
272
|
describe('fetchProductDepositTemplate action', function () {
|
|
260
273
|
beforeEach(function () {
|
|
261
274
|
jest.clearAllMocks();
|
|
275
|
+
apiActions.setShouldReject(false);
|
|
262
276
|
});
|
|
263
|
-
it('should call GetDepositRequestInfoTemplate from
|
|
264
|
-
return _regenerator().w(function (
|
|
265
|
-
while (1) switch (
|
|
277
|
+
it('should call GetDepositRequestInfoTemplate from apiActions', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
278
|
+
return _regenerator().w(function (_context7) {
|
|
279
|
+
while (1) switch (_context7.n) {
|
|
266
280
|
case 0:
|
|
267
|
-
|
|
281
|
+
apiActions.setReturnValue('GetDepositRequestInfoTemplate', {
|
|
268
282
|
depositTemplate: {}
|
|
269
283
|
});
|
|
270
|
-
|
|
284
|
+
_context7.n = 1;
|
|
271
285
|
return store.dispatch(actions.fetchProductDepositTemplate(1));
|
|
272
286
|
case 1:
|
|
273
|
-
expect(
|
|
287
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('GetDepositRequestInfoTemplate', {
|
|
274
288
|
ProductId: 1,
|
|
275
289
|
OMSId: 1,
|
|
276
290
|
AccountId: 1
|
|
277
291
|
});
|
|
278
292
|
case 2:
|
|
279
|
-
return
|
|
293
|
+
return _context7.a(2);
|
|
280
294
|
}
|
|
281
|
-
},
|
|
295
|
+
}, _callee7);
|
|
282
296
|
})));
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
297
|
+
|
|
298
|
+
// fetchProductDepositTemplate takes the AccountProviderId directly as its 2nd argument -
|
|
299
|
+
// it does not look it up from state.deposit.templateTypes (that lookup only exists in
|
|
300
|
+
// getDepositInfo). Real callers (e.g. FiatDepositFormContainer, DepositFormContainer) also
|
|
301
|
+
// pass a concrete AccountProviderId positionally, matching this test.
|
|
302
|
+
it('should call GetDepositRequestInfoTemplate with the given AccountProviderId', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
303
|
+
return _regenerator().w(function (_context8) {
|
|
304
|
+
while (1) switch (_context8.n) {
|
|
287
305
|
case 0:
|
|
288
|
-
|
|
306
|
+
apiActions.setReturnValue('GetDepositRequestInfoTemplate', {
|
|
289
307
|
depositTemplate: {}
|
|
290
308
|
});
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
templateTypes: [{
|
|
294
|
-
TemplateName: 'Standart',
|
|
295
|
-
AccountProviderId: 1
|
|
296
|
-
}]
|
|
297
|
-
};
|
|
298
|
-
store = getStoreMock({}, params);
|
|
299
|
-
_context7.n = 1;
|
|
300
|
-
return store.dispatch(actions.fetchProductDepositTemplate(1, 'Standart'));
|
|
309
|
+
_context8.n = 1;
|
|
310
|
+
return store.dispatch(actions.fetchProductDepositTemplate(1, 1));
|
|
301
311
|
case 1:
|
|
302
|
-
expect(
|
|
312
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('GetDepositRequestInfoTemplate', {
|
|
303
313
|
ProductId: 1,
|
|
304
314
|
OMSId: 1,
|
|
305
315
|
AccountId: 1,
|
|
306
|
-
AccountProviderId: 1
|
|
307
|
-
TemplateType: 'Standart'
|
|
316
|
+
AccountProviderId: 1
|
|
308
317
|
});
|
|
309
318
|
case 2:
|
|
310
|
-
return
|
|
319
|
+
return _context8.a(2);
|
|
311
320
|
}
|
|
312
|
-
},
|
|
321
|
+
}, _callee8);
|
|
313
322
|
})));
|
|
314
|
-
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATE, " action on successful response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
323
|
+
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATE, " action on successful response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
315
324
|
var template;
|
|
316
|
-
return _regenerator().w(function (
|
|
317
|
-
while (1) switch (
|
|
325
|
+
return _regenerator().w(function (_context9) {
|
|
326
|
+
while (1) switch (_context9.n) {
|
|
318
327
|
case 0:
|
|
319
328
|
template = {
|
|
320
329
|
result: true,
|
|
@@ -322,8 +331,8 @@ describe('depositActions', function () {
|
|
|
322
331
|
Template: JSON.stringify({})
|
|
323
332
|
}
|
|
324
333
|
};
|
|
325
|
-
|
|
326
|
-
|
|
334
|
+
apiActions.setReturnValue('GetDepositRequestInfoTemplate', template);
|
|
335
|
+
_context9.n = 1;
|
|
327
336
|
return store.dispatch(actions.fetchProductDepositTemplate(1));
|
|
328
337
|
case 1:
|
|
329
338
|
expect(store.getActions()).toContainEqual({
|
|
@@ -331,14 +340,14 @@ describe('depositActions', function () {
|
|
|
331
340
|
payload: template
|
|
332
341
|
});
|
|
333
342
|
case 2:
|
|
334
|
-
return
|
|
343
|
+
return _context9.a(2);
|
|
335
344
|
}
|
|
336
|
-
},
|
|
345
|
+
}, _callee9);
|
|
337
346
|
})));
|
|
338
|
-
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATE_ERROR, " action if Template === '' in response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
347
|
+
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATE_ERROR, " action if Template === '' in response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
339
348
|
var template;
|
|
340
|
-
return _regenerator().w(function (
|
|
341
|
-
while (1) switch (
|
|
349
|
+
return _regenerator().w(function (_context0) {
|
|
350
|
+
while (1) switch (_context0.n) {
|
|
342
351
|
case 0:
|
|
343
352
|
template = {
|
|
344
353
|
result: true,
|
|
@@ -346,8 +355,8 @@ describe('depositActions', function () {
|
|
|
346
355
|
Template: ''
|
|
347
356
|
}
|
|
348
357
|
};
|
|
349
|
-
|
|
350
|
-
|
|
358
|
+
apiActions.setReturnValue('GetDepositRequestInfoTemplate', template);
|
|
359
|
+
_context0.n = 1;
|
|
351
360
|
return store.dispatch(actions.fetchProductDepositTemplate(1));
|
|
352
361
|
case 1:
|
|
353
362
|
expect(store.getActions()).toContainEqual({
|
|
@@ -355,14 +364,14 @@ describe('depositActions', function () {
|
|
|
355
364
|
payload: 'Server provided an unexpected response'
|
|
356
365
|
});
|
|
357
366
|
case 2:
|
|
358
|
-
return
|
|
367
|
+
return _context0.a(2);
|
|
359
368
|
}
|
|
360
|
-
},
|
|
369
|
+
}, _callee0);
|
|
361
370
|
})));
|
|
362
|
-
it("should dispatch ".concat(actions.FETCH_DEPOSIT_INFO, " action if Template === {Template: {}, UseGetDepositWorkflow: true } in response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
371
|
+
it("should dispatch ".concat(actions.FETCH_DEPOSIT_INFO, " action if Template === {Template: {}, UseGetDepositWorkflow: true } in response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
363
372
|
var template;
|
|
364
|
-
return _regenerator().w(function (
|
|
365
|
-
while (1) switch (
|
|
373
|
+
return _regenerator().w(function (_context1) {
|
|
374
|
+
while (1) switch (_context1.n) {
|
|
366
375
|
case 0:
|
|
367
376
|
template = {
|
|
368
377
|
result: true,
|
|
@@ -372,8 +381,8 @@ describe('depositActions', function () {
|
|
|
372
381
|
},
|
|
373
382
|
DepositInfo: JSON.stringify({})
|
|
374
383
|
};
|
|
375
|
-
|
|
376
|
-
|
|
384
|
+
apiActions.setReturnValue('GetDepositRequestInfoTemplate', template);
|
|
385
|
+
_context1.n = 1;
|
|
377
386
|
return store.dispatch(actions.fetchProductDepositTemplate(1));
|
|
378
387
|
case 1:
|
|
379
388
|
expect(store.getActions()[1]).toEqual({
|
|
@@ -383,21 +392,21 @@ describe('depositActions', function () {
|
|
|
383
392
|
}
|
|
384
393
|
});
|
|
385
394
|
case 2:
|
|
386
|
-
return
|
|
395
|
+
return _context1.a(2);
|
|
387
396
|
}
|
|
388
|
-
},
|
|
397
|
+
}, _callee1);
|
|
389
398
|
})));
|
|
390
|
-
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATE_ERROR, " action on failed response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
399
|
+
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATE_ERROR, " action on failed response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
|
|
391
400
|
var template;
|
|
392
|
-
return _regenerator().w(function (
|
|
393
|
-
while (1) switch (
|
|
401
|
+
return _regenerator().w(function (_context10) {
|
|
402
|
+
while (1) switch (_context10.n) {
|
|
394
403
|
case 0:
|
|
395
404
|
template = {
|
|
396
405
|
result: false,
|
|
397
406
|
errormsg: 'Test error message'
|
|
398
407
|
};
|
|
399
|
-
|
|
400
|
-
|
|
408
|
+
apiActions.setReturnValue('GetDepositRequestInfoTemplate', template);
|
|
409
|
+
_context10.n = 1;
|
|
401
410
|
return store.dispatch(actions.fetchProductDepositTemplate(1));
|
|
402
411
|
case 1:
|
|
403
412
|
expect(store.getActions()).toContainEqual({
|
|
@@ -405,98 +414,102 @@ describe('depositActions', function () {
|
|
|
405
414
|
payload: template.errormsg
|
|
406
415
|
});
|
|
407
416
|
case 2:
|
|
408
|
-
return
|
|
417
|
+
return _context10.a(2);
|
|
409
418
|
}
|
|
410
|
-
},
|
|
419
|
+
}, _callee10);
|
|
411
420
|
})));
|
|
412
|
-
it("should dispatch ".concat(actions.RESET_DEPOSIT_INFO, " action if ProductId is NaN"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
413
|
-
return _regenerator().w(function (
|
|
414
|
-
while (1) switch (
|
|
421
|
+
it("should dispatch ".concat(actions.RESET_DEPOSIT_INFO, " action if ProductId is NaN"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
|
|
422
|
+
return _regenerator().w(function (_context11) {
|
|
423
|
+
while (1) switch (_context11.n) {
|
|
415
424
|
case 0:
|
|
416
|
-
|
|
425
|
+
_context11.n = 1;
|
|
417
426
|
return store.dispatch(actions.fetchProductDepositTemplate(NaN));
|
|
418
427
|
case 1:
|
|
419
428
|
expect(store.getActions()).toContainEqual({
|
|
420
429
|
type: actions.RESET_DEPOSIT_INFO
|
|
421
430
|
});
|
|
422
431
|
case 2:
|
|
423
|
-
return
|
|
432
|
+
return _context11.a(2);
|
|
424
433
|
}
|
|
425
|
-
},
|
|
434
|
+
}, _callee11);
|
|
426
435
|
})));
|
|
427
436
|
});
|
|
428
437
|
describe('createDepositTicket action', function () {
|
|
429
|
-
it("should dispatch ".concat(actions.SUBMITTING_DEPOSIT, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
430
|
-
return _regenerator().w(function (
|
|
431
|
-
while (1) switch (
|
|
438
|
+
it("should dispatch ".concat(actions.SUBMITTING_DEPOSIT, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
|
|
439
|
+
return _regenerator().w(function (_context12) {
|
|
440
|
+
while (1) switch (_context12.n) {
|
|
432
441
|
case 0:
|
|
433
|
-
|
|
434
|
-
DepositInfo: '[]'
|
|
435
|
-
});
|
|
436
|
-
_context11.n = 1;
|
|
442
|
+
_context12.n = 1;
|
|
437
443
|
return store.dispatch(actions.createDepositTicket({}));
|
|
438
444
|
case 1:
|
|
439
445
|
expect(store.getActions()).toContainEqual({
|
|
440
446
|
type: actions.SUBMITTING_DEPOSIT
|
|
441
447
|
});
|
|
442
448
|
case 2:
|
|
443
|
-
return
|
|
449
|
+
return _context12.a(2);
|
|
444
450
|
}
|
|
445
|
-
},
|
|
451
|
+
}, _callee12);
|
|
446
452
|
})));
|
|
447
|
-
it("should dispatch createDepositTicket", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
448
|
-
return _regenerator().w(function (
|
|
449
|
-
while (1) switch (
|
|
453
|
+
it("should dispatch createDepositTicket", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
|
|
454
|
+
return _regenerator().w(function (_context13) {
|
|
455
|
+
while (1) switch (_context13.n) {
|
|
450
456
|
case 0:
|
|
457
|
+
apiActions.setReturnValue('CreateDepositTicket', {
|
|
458
|
+
success: true
|
|
459
|
+
});
|
|
451
460
|
store = getStoreMock({
|
|
452
461
|
UseGetDepositWorkflow: false
|
|
453
462
|
});
|
|
454
|
-
|
|
463
|
+
_context13.n = 1;
|
|
455
464
|
return store.dispatch(actions.createDepositTicket({}));
|
|
456
465
|
case 1:
|
|
457
|
-
expect(
|
|
466
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('CreateDepositTicket', expect.any(Object));
|
|
458
467
|
case 2:
|
|
459
|
-
return
|
|
468
|
+
return _context13.a(2);
|
|
460
469
|
}
|
|
461
|
-
},
|
|
470
|
+
}, _callee13);
|
|
462
471
|
})));
|
|
463
472
|
describe('createDepositTicket confirmation/success UI behavior', function () {
|
|
464
|
-
it('should only show snackbar if config.Deposit.showDepositIdModal == false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
465
|
-
return _regenerator().w(function (
|
|
466
|
-
while (1) switch (
|
|
473
|
+
it('should only show snackbar if config.Deposit.showDepositIdModal == false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
|
|
474
|
+
return _regenerator().w(function (_context14) {
|
|
475
|
+
while (1) switch (_context14.n) {
|
|
467
476
|
case 0:
|
|
468
|
-
|
|
469
|
-
|
|
477
|
+
apiActions.setReturnValue('CreateDepositTicket', {
|
|
478
|
+
success: true
|
|
479
|
+
});
|
|
480
|
+
store = getStoreMock({
|
|
481
|
+
UseGetDepositWorkflow: false
|
|
482
|
+
});
|
|
483
|
+
_context14.n = 1;
|
|
470
484
|
return store.dispatch(actions.createDepositTicket({}));
|
|
471
485
|
case 1:
|
|
472
486
|
expect(snackbarActions.showSnack).toHaveBeenCalled();
|
|
473
487
|
case 2:
|
|
474
|
-
return
|
|
488
|
+
return _context14.a(2);
|
|
475
489
|
}
|
|
476
|
-
},
|
|
490
|
+
}, _callee14);
|
|
477
491
|
})));
|
|
478
|
-
it('should NOT show snackbar if config.Deposit.showDepositIdModal == true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
479
|
-
return _regenerator().w(function (
|
|
480
|
-
while (1) switch (
|
|
492
|
+
it('should NOT show snackbar if config.Deposit.showDepositIdModal == true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
|
|
493
|
+
return _regenerator().w(function (_context15) {
|
|
494
|
+
while (1) switch (_context15.n) {
|
|
481
495
|
case 0:
|
|
482
496
|
_config["default"].Deposit.showDepositIdModal = true;
|
|
497
|
+
apiActions.setReturnValue('CreateDepositTicket', {
|
|
498
|
+
success: true
|
|
499
|
+
});
|
|
483
500
|
jest.clearAllMocks();
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
Deposit: {
|
|
487
|
-
generateNewKey: false,
|
|
488
|
-
showDepositIdModal: true
|
|
489
|
-
}
|
|
490
|
-
};
|
|
501
|
+
store = getStoreMock({
|
|
502
|
+
UseGetDepositWorkflow: false
|
|
491
503
|
});
|
|
492
|
-
|
|
504
|
+
_context15.n = 1;
|
|
493
505
|
return store.dispatch(actions.createDepositTicket({}));
|
|
494
506
|
case 1:
|
|
495
507
|
expect(snackbarActions.showSnack).not.toHaveBeenCalled();
|
|
508
|
+
_config["default"].Deposit.showDepositIdModal = false;
|
|
496
509
|
case 2:
|
|
497
|
-
return
|
|
510
|
+
return _context15.a(2);
|
|
498
511
|
}
|
|
499
|
-
},
|
|
512
|
+
}, _callee15);
|
|
500
513
|
})));
|
|
501
514
|
});
|
|
502
515
|
});
|
|
@@ -504,47 +517,47 @@ describe('depositActions', function () {
|
|
|
504
517
|
beforeEach(function () {
|
|
505
518
|
jest.clearAllMocks();
|
|
506
519
|
});
|
|
507
|
-
it('should call GetDepositInfo
|
|
508
|
-
return _regenerator().w(function (
|
|
509
|
-
while (1) switch (
|
|
520
|
+
it('should call GetDepositInfo via callAPI', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16() {
|
|
521
|
+
return _regenerator().w(function (_context16) {
|
|
522
|
+
while (1) switch (_context16.n) {
|
|
510
523
|
case 0:
|
|
511
|
-
|
|
524
|
+
apiActions.setReturnValue('GetDepositInfo', {
|
|
512
525
|
DepositInfo: '[]'
|
|
513
526
|
});
|
|
514
|
-
|
|
527
|
+
_context16.n = 1;
|
|
515
528
|
return store.dispatch(actions.getDepositInfo(1));
|
|
516
529
|
case 1:
|
|
517
|
-
expect(
|
|
530
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('GetDepositInfo', {
|
|
518
531
|
ProductId: 1,
|
|
519
532
|
OMSId: 1,
|
|
520
533
|
AccountId: 1,
|
|
521
534
|
GenerateNewKey: false
|
|
522
535
|
});
|
|
523
536
|
case 2:
|
|
524
|
-
return
|
|
537
|
+
return _context16.a(2);
|
|
525
538
|
}
|
|
526
|
-
},
|
|
539
|
+
}, _callee16);
|
|
527
540
|
})));
|
|
528
|
-
it('should call GetDepositInfo
|
|
541
|
+
it('should call GetDepositInfo with the AccountProviderId matching the selected template', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
|
|
529
542
|
var params, store;
|
|
530
|
-
return _regenerator().w(function (
|
|
531
|
-
while (1) switch (
|
|
543
|
+
return _regenerator().w(function (_context17) {
|
|
544
|
+
while (1) switch (_context17.n) {
|
|
532
545
|
case 0:
|
|
533
|
-
|
|
546
|
+
apiActions.setReturnValue('GetDepositInfo', {
|
|
534
547
|
DepositInfo: '[]'
|
|
535
548
|
});
|
|
536
549
|
params = {
|
|
537
|
-
|
|
550
|
+
AccountProviderId: 1,
|
|
538
551
|
templateTypes: [{
|
|
539
552
|
TemplateName: 'Standart',
|
|
540
553
|
AccountProviderId: 1
|
|
541
554
|
}]
|
|
542
555
|
};
|
|
543
556
|
store = getStoreMock({}, params);
|
|
544
|
-
|
|
557
|
+
_context17.n = 1;
|
|
545
558
|
return store.dispatch(actions.getDepositInfo(1));
|
|
546
559
|
case 1:
|
|
547
|
-
expect(
|
|
560
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('GetDepositInfo', {
|
|
548
561
|
ProductId: 1,
|
|
549
562
|
OMSId: 1,
|
|
550
563
|
AccountId: 1,
|
|
@@ -552,42 +565,42 @@ describe('depositActions', function () {
|
|
|
552
565
|
AccountProviderId: 1
|
|
553
566
|
});
|
|
554
567
|
case 2:
|
|
555
|
-
return
|
|
568
|
+
return _context17.a(2);
|
|
556
569
|
}
|
|
557
|
-
},
|
|
570
|
+
}, _callee17);
|
|
558
571
|
})));
|
|
559
|
-
it('should forward an explicit generateNewKey override to GetDepositInfo', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
560
|
-
return _regenerator().w(function (
|
|
561
|
-
while (1) switch (
|
|
572
|
+
it('should forward an explicit generateNewKey override to GetDepositInfo', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18() {
|
|
573
|
+
return _regenerator().w(function (_context18) {
|
|
574
|
+
while (1) switch (_context18.n) {
|
|
562
575
|
case 0:
|
|
563
|
-
|
|
576
|
+
apiActions.setReturnValue('GetDepositInfo', {
|
|
564
577
|
DepositInfo: '[]'
|
|
565
578
|
});
|
|
566
|
-
|
|
579
|
+
_context18.n = 1;
|
|
567
580
|
return store.dispatch(actions.getDepositInfo(1, undefined, undefined, true));
|
|
568
581
|
case 1:
|
|
569
|
-
expect(
|
|
582
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('GetDepositInfo', {
|
|
570
583
|
ProductId: 1,
|
|
571
584
|
OMSId: 1,
|
|
572
585
|
AccountId: 1,
|
|
573
586
|
GenerateNewKey: true
|
|
574
587
|
});
|
|
575
588
|
case 2:
|
|
576
|
-
return
|
|
589
|
+
return _context18.a(2);
|
|
577
590
|
}
|
|
578
|
-
},
|
|
591
|
+
}, _callee18);
|
|
579
592
|
})));
|
|
580
|
-
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_INFO, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
593
|
+
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_INFO, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19() {
|
|
581
594
|
var depositInfo;
|
|
582
|
-
return _regenerator().w(function (
|
|
583
|
-
while (1) switch (
|
|
595
|
+
return _regenerator().w(function (_context19) {
|
|
596
|
+
while (1) switch (_context19.n) {
|
|
584
597
|
case 0:
|
|
585
598
|
depositInfo = {
|
|
586
599
|
DepositInfo: '[]',
|
|
587
600
|
result: true
|
|
588
601
|
};
|
|
589
|
-
|
|
590
|
-
|
|
602
|
+
apiActions.setReturnValue('GetDepositInfo', depositInfo);
|
|
603
|
+
_context19.n = 1;
|
|
591
604
|
return store.dispatch(actions.getDepositInfo(1));
|
|
592
605
|
case 1:
|
|
593
606
|
expect(store.getActions()).toContainEqual({
|
|
@@ -595,51 +608,54 @@ describe('depositActions', function () {
|
|
|
595
608
|
payload: []
|
|
596
609
|
});
|
|
597
610
|
case 2:
|
|
598
|
-
return
|
|
611
|
+
return _context19.a(2);
|
|
599
612
|
}
|
|
600
|
-
},
|
|
613
|
+
}, _callee19);
|
|
601
614
|
})));
|
|
602
|
-
it("should dispatch ".concat(actions.RESET_DEPOSIT_INFO, " action if ProductId is NaN"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
603
|
-
return _regenerator().w(function (
|
|
604
|
-
while (1) switch (
|
|
615
|
+
it("should dispatch ".concat(actions.RESET_DEPOSIT_INFO, " action if ProductId is NaN"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20() {
|
|
616
|
+
return _regenerator().w(function (_context20) {
|
|
617
|
+
while (1) switch (_context20.n) {
|
|
605
618
|
case 0:
|
|
606
|
-
|
|
619
|
+
_context20.n = 1;
|
|
607
620
|
return store.dispatch(actions.getDepositInfo('not-a-number'));
|
|
608
621
|
case 1:
|
|
609
622
|
expect(store.getActions()).toContainEqual({
|
|
610
623
|
type: actions.RESET_DEPOSIT_INFO
|
|
611
624
|
});
|
|
612
|
-
expect(
|
|
625
|
+
expect(apiActions.callAPI).not.toHaveBeenCalled();
|
|
613
626
|
case 2:
|
|
614
|
-
return
|
|
627
|
+
return _context20.a(2);
|
|
615
628
|
}
|
|
616
|
-
},
|
|
629
|
+
}, _callee20);
|
|
617
630
|
})));
|
|
618
631
|
});
|
|
619
632
|
describe('getDepositTickets action', function () {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
633
|
+
beforeEach(function () {
|
|
634
|
+
apiActions.setReturnValue('GetDepositTickets', []);
|
|
635
|
+
});
|
|
636
|
+
it('should call GetDepositTickets via callAPI', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21() {
|
|
637
|
+
return _regenerator().w(function (_context21) {
|
|
638
|
+
while (1) switch (_context21.n) {
|
|
623
639
|
case 0:
|
|
624
|
-
|
|
640
|
+
_context21.n = 1;
|
|
625
641
|
return store.dispatch(actions.getDepositTickets());
|
|
626
642
|
case 1:
|
|
627
|
-
expect(
|
|
643
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('GetDepositTickets', {
|
|
628
644
|
OMSId: 1,
|
|
629
645
|
AccountId: 1,
|
|
630
|
-
OperatorId: 1
|
|
646
|
+
OperatorId: 1,
|
|
647
|
+
StartIndex: 0
|
|
631
648
|
});
|
|
632
649
|
case 2:
|
|
633
|
-
return
|
|
650
|
+
return _context21.a(2);
|
|
634
651
|
}
|
|
635
|
-
},
|
|
652
|
+
}, _callee21);
|
|
636
653
|
})));
|
|
637
|
-
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TICKETS, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
638
|
-
return _regenerator().w(function (
|
|
639
|
-
while (1) switch (
|
|
654
|
+
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TICKETS, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22() {
|
|
655
|
+
return _regenerator().w(function (_context22) {
|
|
656
|
+
while (1) switch (_context22.n) {
|
|
640
657
|
case 0:
|
|
641
|
-
|
|
642
|
-
_context21.n = 1;
|
|
658
|
+
_context22.n = 1;
|
|
643
659
|
return store.dispatch(actions.getDepositTickets());
|
|
644
660
|
case 1:
|
|
645
661
|
expect(store.getActions()).toContainEqual({
|
|
@@ -647,9 +663,9 @@ describe('depositActions', function () {
|
|
|
647
663
|
payload: []
|
|
648
664
|
});
|
|
649
665
|
case 2:
|
|
650
|
-
return
|
|
666
|
+
return _context22.a(2);
|
|
651
667
|
}
|
|
652
|
-
},
|
|
668
|
+
}, _callee22);
|
|
653
669
|
})));
|
|
654
670
|
});
|
|
655
671
|
describe('createDepositTicket action', function () {
|
|
@@ -657,21 +673,22 @@ describe('depositActions', function () {
|
|
|
657
673
|
store = getStoreMock({
|
|
658
674
|
UseGetDepositWorkflow: false
|
|
659
675
|
});
|
|
676
|
+
apiActions.setReturnValue('GetDepositTickets', []);
|
|
660
677
|
});
|
|
661
|
-
it('should call CreateDepositTicket
|
|
678
|
+
it('should call CreateDepositTicket via callAPI', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
|
|
662
679
|
var depositInfoPayload;
|
|
663
|
-
return _regenerator().w(function (
|
|
664
|
-
while (1) switch (
|
|
680
|
+
return _regenerator().w(function (_context23) {
|
|
681
|
+
while (1) switch (_context23.n) {
|
|
665
682
|
case 0:
|
|
666
683
|
depositInfoPayload = JSON.stringify({
|
|
667
684
|
fullname: 'John Doe',
|
|
668
685
|
comments: ''
|
|
669
686
|
});
|
|
670
|
-
|
|
687
|
+
apiActions.setReturnValue('CreateDepositTicket', {
|
|
671
688
|
success: true,
|
|
672
689
|
requestCode: 'abcd-efgh-1234-5678'
|
|
673
690
|
});
|
|
674
|
-
|
|
691
|
+
_context23.n = 1;
|
|
675
692
|
return store.dispatch(actions.createDepositTicket({
|
|
676
693
|
ProductId: 1,
|
|
677
694
|
amount: 100,
|
|
@@ -679,7 +696,7 @@ describe('depositActions', function () {
|
|
|
679
696
|
comments: ''
|
|
680
697
|
}));
|
|
681
698
|
case 1:
|
|
682
|
-
expect(
|
|
699
|
+
expect(apiActions.callAPI).toHaveBeenCalledWith('CreateDepositTicket', {
|
|
683
700
|
OMSId: 1,
|
|
684
701
|
OperatorId: 1,
|
|
685
702
|
AccountId: 1,
|
|
@@ -690,25 +707,26 @@ describe('depositActions', function () {
|
|
|
690
707
|
Status: 'New'
|
|
691
708
|
});
|
|
692
709
|
case 2:
|
|
693
|
-
return
|
|
710
|
+
return _context23.a(2);
|
|
694
711
|
}
|
|
695
|
-
},
|
|
712
|
+
}, _callee23);
|
|
696
713
|
})));
|
|
697
714
|
});
|
|
698
|
-
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TICKET, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
715
|
+
it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TICKET, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
|
|
699
716
|
var createTicketResponse;
|
|
700
|
-
return _regenerator().w(function (
|
|
701
|
-
while (1) switch (
|
|
717
|
+
return _regenerator().w(function (_context24) {
|
|
718
|
+
while (1) switch (_context24.n) {
|
|
702
719
|
case 0:
|
|
703
720
|
store = getStoreMock({
|
|
704
721
|
UseGetDepositWorkflow: false
|
|
705
722
|
});
|
|
723
|
+
apiActions.setReturnValue('GetDepositTickets', []);
|
|
706
724
|
createTicketResponse = {
|
|
707
725
|
success: true,
|
|
708
726
|
requestCode: 'abcd-efgh-1234-5678'
|
|
709
727
|
};
|
|
710
|
-
|
|
711
|
-
|
|
728
|
+
apiActions.setReturnValue('CreateDepositTicket', createTicketResponse);
|
|
729
|
+
_context24.n = 1;
|
|
712
730
|
return store.dispatch(actions.createDepositTicket({
|
|
713
731
|
ProductId: 1,
|
|
714
732
|
amount: 100,
|
|
@@ -721,14 +739,14 @@ describe('depositActions', function () {
|
|
|
721
739
|
payload: createTicketResponse
|
|
722
740
|
});
|
|
723
741
|
case 2:
|
|
724
|
-
return
|
|
742
|
+
return _context24.a(2);
|
|
725
743
|
}
|
|
726
|
-
},
|
|
744
|
+
}, _callee24);
|
|
727
745
|
})));
|
|
728
|
-
it("should call showSnack if response result is false", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
746
|
+
it("should call showSnack if response result is false", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25() {
|
|
729
747
|
var createTicketResponse;
|
|
730
|
-
return _regenerator().w(function (
|
|
731
|
-
while (1) switch (
|
|
748
|
+
return _regenerator().w(function (_context25) {
|
|
749
|
+
while (1) switch (_context25.n) {
|
|
732
750
|
case 0:
|
|
733
751
|
store = getStoreMock({
|
|
734
752
|
UseGetDepositWorkflow: false
|
|
@@ -736,8 +754,8 @@ describe('depositActions', function () {
|
|
|
736
754
|
createTicketResponse = {
|
|
737
755
|
result: false
|
|
738
756
|
};
|
|
739
|
-
|
|
740
|
-
|
|
757
|
+
apiActions.setReturnValue('CreateDepositTicket', createTicketResponse);
|
|
758
|
+
_context25.n = 1;
|
|
741
759
|
return store.dispatch(actions.createDepositTicket({
|
|
742
760
|
ProductId: 1,
|
|
743
761
|
amount: 100,
|
|
@@ -747,28 +765,28 @@ describe('depositActions', function () {
|
|
|
747
765
|
case 1:
|
|
748
766
|
expect(snackbarActions.showSnack).toHaveBeenCalled();
|
|
749
767
|
case 2:
|
|
750
|
-
return
|
|
768
|
+
return _context25.a(2);
|
|
751
769
|
}
|
|
752
|
-
},
|
|
770
|
+
}, _callee25);
|
|
753
771
|
})));
|
|
754
772
|
describe('subscribeToDeposits', function () {
|
|
755
|
-
it('should call subscribeToDeposits', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
756
|
-
return _regenerator().w(function (
|
|
757
|
-
while (1) switch (
|
|
773
|
+
it('should call subscribeToDeposits', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26() {
|
|
774
|
+
return _regenerator().w(function (_context26) {
|
|
775
|
+
while (1) switch (_context26.n) {
|
|
758
776
|
case 0:
|
|
759
|
-
|
|
777
|
+
_context26.n = 1;
|
|
760
778
|
return store.dispatch(actions.subscribeToDeposits());
|
|
761
779
|
case 1:
|
|
762
780
|
expect(_depositSubscriptionService["default"].subscribe).toHaveBeenCalled();
|
|
763
781
|
case 2:
|
|
764
|
-
return
|
|
782
|
+
return _context26.a(2);
|
|
765
783
|
}
|
|
766
|
-
},
|
|
784
|
+
}, _callee26);
|
|
767
785
|
})));
|
|
768
|
-
it("should dispatch ".concat(actions.ADD_DEPOSIT, " action with update when subscribed"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
786
|
+
it("should dispatch ".concat(actions.ADD_DEPOSIT, " action with update when subscribed"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27() {
|
|
769
787
|
var updates, expectedActions;
|
|
770
|
-
return _regenerator().w(function (
|
|
771
|
-
while (1) switch (
|
|
788
|
+
return _regenerator().w(function (_context27) {
|
|
789
|
+
while (1) switch (_context27.n) {
|
|
772
790
|
case 0:
|
|
773
791
|
updates = [];
|
|
774
792
|
expectedActions = [{
|
|
@@ -776,14 +794,14 @@ describe('depositActions', function () {
|
|
|
776
794
|
payload: updates
|
|
777
795
|
}];
|
|
778
796
|
_depositSubscriptionService["default"].setUpdateData(updates);
|
|
779
|
-
|
|
797
|
+
_context27.n = 1;
|
|
780
798
|
return store.dispatch(actions.subscribeToDeposits());
|
|
781
799
|
case 1:
|
|
782
800
|
expect(store.getActions()).toEqual(expectedActions);
|
|
783
801
|
case 2:
|
|
784
|
-
return
|
|
802
|
+
return _context27.a(2);
|
|
785
803
|
}
|
|
786
|
-
},
|
|
804
|
+
}, _callee27);
|
|
787
805
|
})));
|
|
788
806
|
});
|
|
789
807
|
});
|