@alphapoint/apex-web 5.5.5-fe.1 → 5.5.6
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/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/FuturesOrderBook/FuturesOrderBookContainer.js +6 -0
- package/lib/components/KYC/kycLevelsVerificationPropsHelper.test.js +7 -8
- 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/Signup/SignupFormComponent.js +10 -1
- package/lib/components/Theme/ThemeToggler/ThemeToggler.js +4 -1
- 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/config/configDefault.json +1 -0
- package/lib/helpers/dateHelper.test.js +11 -5
- package/lib/helpers/destinationTagHelper.test.js +14 -5
- package/lib/helpers/formValidations.test.js +19 -3
- 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/wsHelper.test.js +16 -7
- package/lib/redux/actions/affiliateActions.test.js +22 -27
- package/lib/redux/actions/apiKeyActions.test.js +29 -34
- 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/instrumentActions.test.js +560 -160
- 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/orderEntryActions.js +32 -5
- package/lib/redux/actions/orderEntryActions.test.js +104 -37
- 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.test.js +539 -305
- package/lib/redux/actions/verifyEmailActions.test.js +13 -2
- package/lib/redux/actions/withdrawActions.test.js +163 -154
- package/lib/redux/actions/wsConnectionActions.test.js +9 -8
- 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.test.js +7 -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/recentTradesSelectors.test.js +17 -0
- package/lib/redux/selectors/transfersTableSelectors.test.js +7 -1
- 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/MarginDepositWithdraw/MarginDepositWithdrawContainer.notest.js +0 -83
- 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
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var _react = _interopRequireDefault(require("react"));
|
|
5
|
-
var _enzyme = require("enzyme");
|
|
6
|
-
var _reduxMockStore = _interopRequireDefault(require("redux-mock-store"));
|
|
7
|
-
var _ConfirmBlockTradeModalContainer = _interopRequireDefault(require("./ConfirmBlockTradeModalContainer"));
|
|
8
|
-
var _modalDecorator = _interopRequireDefault(require("../../hocs/modalDecorator"));
|
|
9
|
-
var _modalActions = require("../../redux/actions/modalActions");
|
|
10
|
-
var _orderFormTypes = require("../../constants/sendOrder/orderFormTypes");
|
|
11
|
-
var orderEntryActions = _interopRequireWildcard(require("../../redux/actions/orderEntryActions"));
|
|
12
|
-
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); }
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
-
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
15
|
-
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
16
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
17
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
18
|
-
jest.mock('./ConfirmBlockTradeModalComponent', function () {
|
|
19
|
-
return function () {
|
|
20
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
21
|
-
className: "component"
|
|
22
|
-
}, "Content");
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
jest.mock('../../hocs/modalDecorator', function () {
|
|
26
|
-
return jest.fn(function () {
|
|
27
|
-
return function (Component) {
|
|
28
|
-
return Component;
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
jest.mock('../../redux/actions/orderEntryActions', function () {
|
|
33
|
-
return {
|
|
34
|
-
placeOrder: jest.fn(function (payload) {
|
|
35
|
-
return Promise.resolve({
|
|
36
|
-
status: 'Accepted'
|
|
37
|
-
});
|
|
38
|
-
}),
|
|
39
|
-
clearOrderForm: jest.fn(function () {
|
|
40
|
-
return {
|
|
41
|
-
type: 'reset'
|
|
42
|
-
};
|
|
43
|
-
})
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
describe('ConfirmBlockTradeModalContainer', function () {
|
|
47
|
-
var state = {
|
|
48
|
-
form: {
|
|
49
|
-
reportBlockTrade: {
|
|
50
|
-
values: {
|
|
51
|
-
fee: {
|
|
52
|
-
ProductId: 1
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
tradingStyle: {
|
|
57
|
-
values: {
|
|
58
|
-
tradingStyle: 'Standard'
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
margin: {
|
|
63
|
-
instrument: {
|
|
64
|
-
fetching: true
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
user: {
|
|
68
|
-
userInfo: {
|
|
69
|
-
MarginBorrowerEnabled: false
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
apexCore: {
|
|
73
|
-
instrument: {
|
|
74
|
-
instruments: [{
|
|
75
|
-
InstrumentId: '1',
|
|
76
|
-
Product1: 1,
|
|
77
|
-
Product2: 2
|
|
78
|
-
}],
|
|
79
|
-
selectedInstrumentId: '1'
|
|
80
|
-
},
|
|
81
|
-
product: {
|
|
82
|
-
products: [{
|
|
83
|
-
ProductId: 1,
|
|
84
|
-
ProductFullName: 'foo',
|
|
85
|
-
Product: 'USD'
|
|
86
|
-
}, {
|
|
87
|
-
ProductId: 2,
|
|
88
|
-
ProductFullName: 'bar',
|
|
89
|
-
Product: 'BTC'
|
|
90
|
-
}]
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
var asyncMiddleware = function asyncMiddleware(store) {
|
|
95
|
-
return function (next) {
|
|
96
|
-
return /*#__PURE__*/function () {
|
|
97
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(action) {
|
|
98
|
-
return _regenerator().w(function (_context) {
|
|
99
|
-
while (1) switch (_context.n) {
|
|
100
|
-
case 0:
|
|
101
|
-
if (!action.then) {
|
|
102
|
-
_context.n = 2;
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
_context.n = 1;
|
|
106
|
-
return action;
|
|
107
|
-
case 1:
|
|
108
|
-
return _context.a(2, _context.v);
|
|
109
|
-
case 2:
|
|
110
|
-
next(action);
|
|
111
|
-
case 3:
|
|
112
|
-
return _context.a(2);
|
|
113
|
-
}
|
|
114
|
-
}, _callee);
|
|
115
|
-
}));
|
|
116
|
-
return function (_x) {
|
|
117
|
-
return _ref.apply(this, arguments);
|
|
118
|
-
};
|
|
119
|
-
}();
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
var mockStore = (0, _reduxMockStore["default"])([asyncMiddleware]);
|
|
123
|
-
var store, container;
|
|
124
|
-
beforeEach(function () {
|
|
125
|
-
store = mockStore(state);
|
|
126
|
-
container = (0, _enzyme.mount)(/*#__PURE__*/_react["default"].createElement(_ConfirmBlockTradeModalContainer["default"], {
|
|
127
|
-
store: store
|
|
128
|
-
}));
|
|
129
|
-
});
|
|
130
|
-
it('should render ConfirmBlockTradeModalComponent', function () {
|
|
131
|
-
expect(container.find('.component').length).toBe(1);
|
|
132
|
-
});
|
|
133
|
-
it('should wrap container into modal decorator with modal name', function () {
|
|
134
|
-
var modalDecoratorArgs = _modalDecorator["default"].mock.calls[0][0];
|
|
135
|
-
expect(modalDecoratorArgs.name).toBe(_modalActions.MODAL_TYPES.CONFIRM_BLOCK_REPORT);
|
|
136
|
-
});
|
|
137
|
-
it('should pass correct props to component', function () {
|
|
138
|
-
expect(container.childAt(0).prop('formObj')).toBeDefined();
|
|
139
|
-
expect(container.childAt(0).prop('selectedInstrument')).toBeDefined();
|
|
140
|
-
expect(container.childAt(0).prop('selectedInstrument')).toEqual({
|
|
141
|
-
InstrumentId: '1',
|
|
142
|
-
Product1: 1,
|
|
143
|
-
Product2: 2,
|
|
144
|
-
Product1FullName: 'foo',
|
|
145
|
-
Product2FullName: 'bar',
|
|
146
|
-
Product1Symbol: 'USD',
|
|
147
|
-
Product2Symbol: 'BTC'
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
it('should pass confirmReport to component', function () {
|
|
151
|
-
expect(container.childAt(0).prop('confirmReport')).toBeDefined();
|
|
152
|
-
});
|
|
153
|
-
it('confirmReport should dispatch place order action with form values and reset form', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
154
|
-
var formValues;
|
|
155
|
-
return _regenerator().w(function (_context2) {
|
|
156
|
-
while (1) switch (_context2.n) {
|
|
157
|
-
case 0:
|
|
158
|
-
formValues = _orderFormTypes.orderFormTypes.block;
|
|
159
|
-
_context2.n = 1;
|
|
160
|
-
return container.childAt(0).prop('confirmReport')(formValues, store.dispatch);
|
|
161
|
-
case 1:
|
|
162
|
-
expect(orderEntryActions.placeOrder).toHaveBeenCalled();
|
|
163
|
-
expect(store.getActions()).toContainEqual({
|
|
164
|
-
type: 'reset'
|
|
165
|
-
});
|
|
166
|
-
case 2:
|
|
167
|
-
return _context2.a(2);
|
|
168
|
-
}
|
|
169
|
-
}, _callee2);
|
|
170
|
-
})));
|
|
171
|
-
});
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var _react = _interopRequireDefault(require("react"));
|
|
5
|
-
var _enzyme = require("enzyme");
|
|
6
|
-
var _reduxMockStore = _interopRequireDefault(require("redux-mock-store"));
|
|
7
|
-
var _ConfirmLimitOrderModalContainer = _interopRequireDefault(require("./ConfirmLimitOrderModalContainer"));
|
|
8
|
-
var _modalDecorator = _interopRequireDefault(require("../../hocs/modalDecorator"));
|
|
9
|
-
var _modalActions = require("../../redux/actions/modalActions");
|
|
10
|
-
var _orderFormTypes = require("../../constants/sendOrder/orderFormTypes");
|
|
11
|
-
var orderEntryActions = _interopRequireWildcard(require("../../redux/actions/orderEntryActions"));
|
|
12
|
-
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); }
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
-
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
15
|
-
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
16
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
17
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
18
|
-
jest.mock('./ConfirmLimitOrderModalComponent', function () {
|
|
19
|
-
return function () {
|
|
20
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
21
|
-
className: "component"
|
|
22
|
-
}, "Content");
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
jest.mock('../../hocs/modalDecorator', function () {
|
|
26
|
-
return jest.fn(function () {
|
|
27
|
-
return function (Component) {
|
|
28
|
-
return Component;
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
jest.mock('../../redux/actions/orderEntryActions', function () {
|
|
33
|
-
return {
|
|
34
|
-
placeOrder: jest.fn(function () {
|
|
35
|
-
return Promise.resolve({
|
|
36
|
-
status: 'Accepted'
|
|
37
|
-
});
|
|
38
|
-
}),
|
|
39
|
-
clearOrderForm: jest.fn(function () {
|
|
40
|
-
return {
|
|
41
|
-
type: 'reset'
|
|
42
|
-
};
|
|
43
|
-
})
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
describe('ConfirmLimitOrderModalContainer', function () {
|
|
47
|
-
var state = {
|
|
48
|
-
form: {
|
|
49
|
-
orderEntry: {
|
|
50
|
-
values: {
|
|
51
|
-
limitPrice: '10',
|
|
52
|
-
orderType: 'Limit Order',
|
|
53
|
-
side: '1',
|
|
54
|
-
quantity: 1
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
tradingStyle: {
|
|
58
|
-
values: {
|
|
59
|
-
tradingStyle: 'Standard'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
apexCore: {
|
|
64
|
-
instrument: {
|
|
65
|
-
instruments: [{
|
|
66
|
-
InstrumentId: 1,
|
|
67
|
-
Product2Symbol: 'USD',
|
|
68
|
-
Product2: 2,
|
|
69
|
-
Product1: 1
|
|
70
|
-
}],
|
|
71
|
-
selectedInstrumentId: 1
|
|
72
|
-
},
|
|
73
|
-
level1: {
|
|
74
|
-
1: {
|
|
75
|
-
InstrumentId: 1,
|
|
76
|
-
BestOffer: '20'
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
product: {
|
|
80
|
-
products: [{
|
|
81
|
-
ProductId: 2,
|
|
82
|
-
ProductFullName: 'foo',
|
|
83
|
-
Product: 'USD'
|
|
84
|
-
}, {
|
|
85
|
-
ProductId: 1,
|
|
86
|
-
ProductFullName: 'bar',
|
|
87
|
-
Product: 'BTC'
|
|
88
|
-
}]
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
margin: {
|
|
92
|
-
instrument: {
|
|
93
|
-
fetching: true
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
user: {
|
|
97
|
-
userInfo: {
|
|
98
|
-
MarginBorrowerEnabled: false
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
var asyncMiddleware = function asyncMiddleware(store) {
|
|
103
|
-
return function (next) {
|
|
104
|
-
return /*#__PURE__*/function () {
|
|
105
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(action) {
|
|
106
|
-
return _regenerator().w(function (_context) {
|
|
107
|
-
while (1) switch (_context.n) {
|
|
108
|
-
case 0:
|
|
109
|
-
if (!action.then) {
|
|
110
|
-
_context.n = 2;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
_context.n = 1;
|
|
114
|
-
return action;
|
|
115
|
-
case 1:
|
|
116
|
-
return _context.a(2, _context.v);
|
|
117
|
-
case 2:
|
|
118
|
-
next(action);
|
|
119
|
-
case 3:
|
|
120
|
-
return _context.a(2);
|
|
121
|
-
}
|
|
122
|
-
}, _callee);
|
|
123
|
-
}));
|
|
124
|
-
return function (_x) {
|
|
125
|
-
return _ref.apply(this, arguments);
|
|
126
|
-
};
|
|
127
|
-
}();
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
var mockStore = (0, _reduxMockStore["default"])([asyncMiddleware]);
|
|
131
|
-
var store, container;
|
|
132
|
-
beforeEach(function () {
|
|
133
|
-
store = mockStore(state);
|
|
134
|
-
container = (0, _enzyme.mount)(/*#__PURE__*/_react["default"].createElement(_ConfirmLimitOrderModalContainer["default"], {
|
|
135
|
-
store: store,
|
|
136
|
-
orderFormType: "default"
|
|
137
|
-
}));
|
|
138
|
-
});
|
|
139
|
-
it('should render ConfirmLimitOrderModalComponent', function () {
|
|
140
|
-
expect(container.find('.component').length).toBe(1);
|
|
141
|
-
});
|
|
142
|
-
it('should wrap container into modal decorator with modal name', function () {
|
|
143
|
-
var modalDecoratorArgs = _modalDecorator["default"].mock.calls[0][0];
|
|
144
|
-
expect(modalDecoratorArgs.name).toBe(_modalActions.MODAL_TYPES.SUBMIT_LIMIT_ORDER);
|
|
145
|
-
});
|
|
146
|
-
it('should pass correct props to component', function () {
|
|
147
|
-
expect(container.childAt(0).prop('limitPrice')).toEqual('10');
|
|
148
|
-
expect(container.childAt(0).prop('marketPrice')).toEqual('20');
|
|
149
|
-
expect(container.childAt(0).prop('priceSymbol')).toEqual('USD');
|
|
150
|
-
expect(container.childAt(0).prop('formObj')).toEqual({
|
|
151
|
-
limitPrice: '10',
|
|
152
|
-
orderType: 'Limit Order',
|
|
153
|
-
quantity: 1,
|
|
154
|
-
side: '1'
|
|
155
|
-
});
|
|
156
|
-
expect(container.childAt(0).prop('orderFormType')).toEqual('default');
|
|
157
|
-
});
|
|
158
|
-
it('should pass confirmOrder to component', function () {
|
|
159
|
-
expect(container.childAt(0).prop('confirmOrder')).toBeDefined();
|
|
160
|
-
});
|
|
161
|
-
it('confirmOrder should dispatch place order action with form values and reset form', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
162
|
-
var formValues;
|
|
163
|
-
return _regenerator().w(function (_context2) {
|
|
164
|
-
while (1) switch (_context2.n) {
|
|
165
|
-
case 0:
|
|
166
|
-
formValues = _orderFormTypes.orderFormTypes.block;
|
|
167
|
-
_context2.n = 1;
|
|
168
|
-
return container.childAt(0).prop('confirmOrder')(formValues, store.dispatch);
|
|
169
|
-
case 1:
|
|
170
|
-
expect(orderEntryActions.placeOrder).toHaveBeenCalled();
|
|
171
|
-
expect(store.getActions()).toContainEqual({
|
|
172
|
-
type: 'reset'
|
|
173
|
-
});
|
|
174
|
-
case 2:
|
|
175
|
-
return _context2.a(2);
|
|
176
|
-
}
|
|
177
|
-
}, _callee2);
|
|
178
|
-
})));
|
|
179
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
var _enzyme = require("enzyme");
|
|
5
|
-
var _reduxMockStore = _interopRequireDefault(require("redux-mock-store"));
|
|
6
|
-
var _ConfirmWithdrawContainer = _interopRequireDefault(require("./ConfirmWithdrawContainer"));
|
|
7
|
-
var _ConfirmWithdrawComponent = _interopRequireDefault(require("./ConfirmWithdrawComponent"));
|
|
8
|
-
var _confirmWithdrawActions = require("../../redux/actions/confirmWithdrawActions");
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
-
jest.mock('../../redux/actions/confirmWithdrawActions', function () {
|
|
11
|
-
return {
|
|
12
|
-
fetchConfirmWithdraw: jest.fn(function (payload) {
|
|
13
|
-
return {
|
|
14
|
-
type: 'ACTION',
|
|
15
|
-
payload: payload
|
|
16
|
-
};
|
|
17
|
-
})
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
jest.mock('./ConfirmWithdrawComponent', function () {
|
|
21
|
-
return function () {
|
|
22
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
23
|
-
className: "component"
|
|
24
|
-
}, "Content");
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
describe('ConfirmWithdrawContainer', function () {
|
|
28
|
-
var mockStore = (0, _reduxMockStore["default"])();
|
|
29
|
-
var store, container;
|
|
30
|
-
beforeEach(function () {
|
|
31
|
-
store = mockStore({
|
|
32
|
-
apiProcessing: {
|
|
33
|
-
processingConfirmWithdraw: false
|
|
34
|
-
},
|
|
35
|
-
confirmWithdraw: {
|
|
36
|
-
message: 'Hello',
|
|
37
|
-
error: false
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
container = (0, _enzyme.shallow)(/*#__PURE__*/_react["default"].createElement(_ConfirmWithdrawContainer["default"], {
|
|
41
|
-
store: store
|
|
42
|
-
}));
|
|
43
|
-
});
|
|
44
|
-
it('renders <ConfirmWithdrawComponent />', function () {
|
|
45
|
-
return expect(container.find(_ConfirmWithdrawComponent["default"]).length).toEqual(1);
|
|
46
|
-
});
|
|
47
|
-
it('passes the expected props down', function () {
|
|
48
|
-
return expect(container.find(_ConfirmWithdrawComponent["default"]).props()).toEqual(expect.objectContaining({
|
|
49
|
-
processingConfirmWithdraw: expect.any(Boolean),
|
|
50
|
-
message: expect.any(String),
|
|
51
|
-
error: expect.any(Boolean)
|
|
52
|
-
}));
|
|
53
|
-
});
|
|
54
|
-
it('passes the fetchConfirmWithdaw action', function () {
|
|
55
|
-
container.find(_ConfirmWithdrawComponent["default"]).props().fetchConfirmWithdraw();
|
|
56
|
-
expect(_confirmWithdrawActions.fetchConfirmWithdraw).toHaveBeenCalled();
|
|
57
|
-
});
|
|
58
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
var _enzyme = require("enzyme");
|
|
5
|
-
var _reduxMockStore = _interopRequireDefault(require("redux-mock-store"));
|
|
6
|
-
var _DepositConfirmationModalContainer = _interopRequireDefault(require("./DepositConfirmationModalContainer"));
|
|
7
|
-
var _DepositConfirmationModalComponent = _interopRequireDefault(require("./DepositConfirmationModalComponent"));
|
|
8
|
-
var _modalDecorator = _interopRequireDefault(require("../../hocs/modalDecorator"));
|
|
9
|
-
var _modalActions = require("../../redux/actions/modalActions");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
-
jest.mock('../../hocs/modalDecorator', function () {
|
|
12
|
-
return jest.fn(function () {
|
|
13
|
-
return function (Component) {
|
|
14
|
-
return Component;
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
jest.mock('../../redux/actions/modalActions', function () {
|
|
19
|
-
return {
|
|
20
|
-
openModal: jest.fn(function () {
|
|
21
|
-
return {
|
|
22
|
-
type: 'OPEN_MODAL'
|
|
23
|
-
};
|
|
24
|
-
}),
|
|
25
|
-
MODAL_TYPES: {
|
|
26
|
-
DEPOSIT_STATUS: 'DEPOSIT_STATUS'
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
jest.mock('./DepositConfirmationModalComponent', function () {
|
|
31
|
-
return function () {
|
|
32
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, "Content");
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
describe('DepositConfirmationModalContainer', function () {
|
|
36
|
-
var store, container;
|
|
37
|
-
var mockStore = (0, _reduxMockStore["default"])();
|
|
38
|
-
beforeEach(function () {
|
|
39
|
-
store = mockStore();
|
|
40
|
-
container = (0, _enzyme.shallow)(/*#__PURE__*/_react["default"].createElement(_DepositConfirmationModalContainer["default"], {
|
|
41
|
-
store: store
|
|
42
|
-
}));
|
|
43
|
-
});
|
|
44
|
-
it('renders <DepositConfirmationModalComponent />', function () {
|
|
45
|
-
expect(container.find(_DepositConfirmationModalComponent["default"]).length).toEqual(1);
|
|
46
|
-
});
|
|
47
|
-
it('wraps <DepositConfirmationModalComponent /> as a modal with a name', function () {
|
|
48
|
-
expect(_modalDecorator["default"].mock.calls[0][0].name).toEqual(_modalActions.MODAL_TYPES.DEPOSIT_STATUS);
|
|
49
|
-
});
|
|
50
|
-
it('Should pass openModal action to component', function () {
|
|
51
|
-
expect(container.instance().selector.props.openModal).toBeDefined();
|
|
52
|
-
});
|
|
53
|
-
it('openModal should dispatch openModal action', function () {
|
|
54
|
-
container.instance().selector.props.openModal();
|
|
55
|
-
expect(store.getActions()).toEqual([{
|
|
56
|
-
type: 'OPEN_MODAL'
|
|
57
|
-
}]);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
var _enzyme = require("enzyme");
|
|
5
|
-
var _DepositFormComponent = _interopRequireDefault(require("./DepositFormComponent"));
|
|
6
|
-
var _Spinner = _interopRequireDefault(require("../common/Spinner/Spinner"));
|
|
7
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
8
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
9
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
-
describe('DepositFormComponent', function () {
|
|
15
|
-
var subject = null;
|
|
16
|
-
var submitting;
|
|
17
|
-
var onSubmitResponse;
|
|
18
|
-
var handleSubmit;
|
|
19
|
-
var closeSidePane;
|
|
20
|
-
var deposit;
|
|
21
|
-
var product;
|
|
22
|
-
var selectDepositProduct;
|
|
23
|
-
var selectDepositProductResponse;
|
|
24
|
-
var onSidePaneOpen;
|
|
25
|
-
beforeEach(function () {
|
|
26
|
-
subject = null;
|
|
27
|
-
submitting = false;
|
|
28
|
-
deposit = {
|
|
29
|
-
template: {},
|
|
30
|
-
templateInfo: {},
|
|
31
|
-
templateTypes: [],
|
|
32
|
-
isLoading: false,
|
|
33
|
-
error: '',
|
|
34
|
-
depositInfo: [],
|
|
35
|
-
depositStatus: {
|
|
36
|
-
success: false
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
product = {
|
|
40
|
-
ProductId: 1
|
|
41
|
-
};
|
|
42
|
-
handleSubmit = function handleSubmit(fn) {
|
|
43
|
-
return fn;
|
|
44
|
-
};
|
|
45
|
-
closeSidePane = jest.fn();
|
|
46
|
-
onSubmitResponse = Promise.resolve();
|
|
47
|
-
selectDepositProduct = function selectDepositProduct(fn) {
|
|
48
|
-
return fn;
|
|
49
|
-
};
|
|
50
|
-
selectDepositProductResponse = Promise.resolve();
|
|
51
|
-
});
|
|
52
|
-
var buildSubject = function buildSubject() {
|
|
53
|
-
var passedProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
54
|
-
handleSubmit = jest.fn(function () {
|
|
55
|
-
return onSubmitResponse;
|
|
56
|
-
});
|
|
57
|
-
onSidePaneOpen = function onSidePaneOpen() {};
|
|
58
|
-
selectDepositProduct = jest.fn(function () {
|
|
59
|
-
return selectDepositProductResponse;
|
|
60
|
-
});
|
|
61
|
-
var props = _objectSpread({
|
|
62
|
-
closeSidePane: closeSidePane,
|
|
63
|
-
handleSubmit: handleSubmit,
|
|
64
|
-
onSidePaneOpen: onSidePaneOpen,
|
|
65
|
-
submitting: submitting,
|
|
66
|
-
deposit: deposit,
|
|
67
|
-
product: product,
|
|
68
|
-
selectDepositProduct: selectDepositProduct
|
|
69
|
-
}, passedProps);
|
|
70
|
-
return (0, _enzyme.shallow)(/*#__PURE__*/_react["default"].createElement(_DepositFormComponent["default"], props), {
|
|
71
|
-
context: {
|
|
72
|
-
t: function t(v) {
|
|
73
|
-
return v;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
it('renders an error message when depositInfo prop has an error in it', function () {
|
|
79
|
-
subject = buildSubject({
|
|
80
|
-
deposit: {
|
|
81
|
-
template: {},
|
|
82
|
-
templateInfo: {},
|
|
83
|
-
templateTypes: [],
|
|
84
|
-
isLoading: false,
|
|
85
|
-
error: 'Account provider 0 not found',
|
|
86
|
-
depositInfo: [],
|
|
87
|
-
depositStatus: {}
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
expect(subject.find('p.deposit-form__error').text()).toBe('Account provider 0 not found');
|
|
91
|
-
});
|
|
92
|
-
it('renders spinner when depositInfo prop contains isLoading === true', function () {
|
|
93
|
-
subject = buildSubject({
|
|
94
|
-
deposit: {
|
|
95
|
-
template: {},
|
|
96
|
-
templateInfo: {},
|
|
97
|
-
templateTypes: [],
|
|
98
|
-
isLoading: true,
|
|
99
|
-
error: '',
|
|
100
|
-
depositInfo: [],
|
|
101
|
-
depositStatus: {}
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
expect(subject.find(_Spinner["default"]).length).toBe(1);
|
|
105
|
-
});
|
|
106
|
-
it('calls handleSubmit when submitting form', function () {
|
|
107
|
-
subject = buildSubject({
|
|
108
|
-
deposit: {
|
|
109
|
-
template: {},
|
|
110
|
-
templateInfo: {},
|
|
111
|
-
templateTypes: [],
|
|
112
|
-
isLoading: false,
|
|
113
|
-
error: '',
|
|
114
|
-
depositInfo: [{
|
|
115
|
-
ProductId: 1
|
|
116
|
-
}],
|
|
117
|
-
depositStatus: {}
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
subject.find('form').simulate('submit');
|
|
121
|
-
expect(handleSubmit).toHaveBeenCalledTimes(1);
|
|
122
|
-
});
|
|
123
|
-
});
|