@alphapoint/apex-web 5.5.5 → 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.
Files changed (357) hide show
  1. package/lib/App.js +30 -18
  2. package/lib/components/DepositSidePaneComponents/DepositFormComponent.js +2 -7
  3. package/lib/components/DigitalAssets/DigitalAssetsOfferingProfilePage.css +6 -3
  4. package/lib/components/DigitalAssets/DigitalAssetsOfferingProfilePage.js +2 -2
  5. package/lib/components/DigitalAssets/DigitalAssetsPage.js +1 -1
  6. package/lib/components/FusionAuth/ConfirmPendingWithdrawModal.js +60 -0
  7. package/lib/components/FusionAuth/FusionAuthCallbackComponent.js +66 -0
  8. package/lib/components/FusionAuth/FusionAuthCallbackContainer.js +24 -0
  9. package/lib/components/FusionAuth/FusionStepUpModal.js +63 -0
  10. package/lib/components/FusionAuth/LinkOAuthIdentityModal.css +6 -0
  11. package/lib/components/FusionAuth/LinkOAuthIdentityModal.js +65 -0
  12. package/lib/components/FuturesOrderBook/FuturesOrderBookContainer.js +6 -0
  13. package/lib/components/KYC/kycLevelsVerificationPropsHelper.test.js +7 -8
  14. package/lib/components/Login/LoginFormComponent.js +15 -4
  15. package/lib/components/Login/LoginFormContainer.js +21 -26
  16. package/lib/components/OrderBookComponents/Level2DataTableComponent.js +4 -0
  17. package/lib/components/OrderBookComponents/OrderBookComponent.css +1 -0
  18. package/lib/components/OrderBookComponents/OrderBookComponent.js +7 -2
  19. package/lib/components/OrderBookComponents/OrderBookContainer.js +3 -1
  20. package/lib/components/OrderEntryComponents/defaultForm/BuySellTabs.js +11 -5
  21. package/lib/components/OrderEntryComponents/defaultForm/OrderEntryAnchoring.js +19 -3
  22. package/lib/components/OrderHistoryComponents/OpenOrders/OpenOrdersComponent.js +1 -1
  23. package/lib/components/OrderHistoryComponents/OpenOrders/OpenOrdersComponent.test.js +97 -73
  24. package/lib/components/PriceChart/TVChartComponent.js +47 -2
  25. package/lib/components/PriceChart/TVChartContainer.js +2 -1
  26. package/lib/components/Retail/RetailSidePanes/FiatDeposit/FiatDepositFormComponent.js +2 -6
  27. package/lib/components/Retail/RetailSidePanes/FiatWithdraw/FiatWithdrawFormComponent.js +2 -6
  28. package/lib/components/SendReceiveSidePane/ReceiveAddress/ReceiveAddressComponent.js +2 -6
  29. package/lib/components/SendReceiveSidePane/SendAddress/SendAddressComponent.js +2 -7
  30. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/ProfileFormComponent.js +3 -1
  31. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.css +10 -0
  32. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/SsoLinkRowComponent.js +77 -0
  33. package/lib/components/Signup/SignupFormComponent.js +10 -1
  34. package/lib/components/Theme/ThemeToggler/ThemeToggler.js +4 -1
  35. package/lib/components/WithdrawSidePaneComponents/WithdrawForm/WithdrawFormComponent.js +3 -8
  36. package/lib/components/common/APRecaptcha/APRecaptcha.css +33 -0
  37. package/lib/components/common/APRecaptcha/APRecaptcha.js +252 -0
  38. package/lib/components/common/APRecaptcha/index.js +22 -0
  39. package/lib/config/configDefault.json +9 -2
  40. package/lib/helpers/accountProviderHelper.js +28 -0
  41. package/lib/helpers/accountProviderHelper.test.js +67 -0
  42. package/lib/helpers/dateHelper.test.js +11 -5
  43. package/lib/helpers/destinationTagHelper.test.js +14 -5
  44. package/lib/helpers/formValidations.test.js +19 -3
  45. package/lib/helpers/fusionStepUp.js +79 -0
  46. package/lib/helpers/fusionStepUp.test.js +136 -0
  47. package/lib/helpers/homePageLayoutHelper.test.js +16 -2
  48. package/lib/helpers/numberFormatter/numberFormatter.js +3 -1
  49. package/lib/helpers/numberFormatter/numberFormatter.test.js +9 -2
  50. package/lib/helpers/orderHelper.test.js +59 -38
  51. package/lib/helpers/placeOrderHelper.js +9 -2
  52. package/lib/helpers/placeOrderHelper.test.js +43 -16
  53. package/lib/helpers/recalculateOrderHelper.test.js +49 -12
  54. package/lib/helpers/safeSessionStorage.js +36 -0
  55. package/lib/helpers/wsHelper.test.js +16 -7
  56. package/lib/redux/actions/affiliateActions.test.js +22 -27
  57. package/lib/redux/actions/apiKeyActions.test.js +29 -34
  58. package/lib/redux/actions/authActions.js +581 -48
  59. package/lib/redux/actions/authActions.test.js +140 -164
  60. package/lib/redux/actions/confirmWithdrawActions.js +7 -2
  61. package/lib/redux/actions/confirmWithdrawActions.test.js +83 -29
  62. package/lib/redux/actions/depositActions.test.js +267 -249
  63. package/lib/redux/actions/eotcActions.test.js +3 -0
  64. package/lib/redux/actions/eotcSettlementActions.test.js +3 -0
  65. package/lib/redux/actions/eotcWithdrawActions.test.js +3 -0
  66. package/lib/redux/actions/fusionAuthActions.test.js +717 -0
  67. package/lib/redux/actions/instrumentActions.test.js +560 -160
  68. package/lib/redux/actions/kycIdentityMindActions.js +4 -4
  69. package/lib/redux/actions/kycIdentityMindActions.test.js +31 -13
  70. package/lib/redux/actions/kycJumioActions.test.js +16 -6
  71. package/lib/redux/actions/kycManualActions.test.js +16 -9
  72. package/lib/redux/actions/level1Actions.test.js +2 -2
  73. package/lib/redux/actions/level2Actions.test.js +51 -120
  74. package/lib/redux/actions/loyaltyFeeActions.test.js +19 -16
  75. package/lib/redux/actions/marketStateUpdateActions.test.js +2 -2
  76. package/lib/redux/actions/modalActions.js +3 -0
  77. package/lib/redux/actions/orderEntryActions.js +32 -5
  78. package/lib/redux/actions/orderEntryActions.test.js +104 -37
  79. package/lib/redux/actions/orderHistoryActions.test.js +94 -79
  80. package/lib/redux/actions/positionActions.test.js +19 -4
  81. package/lib/redux/actions/productActions.test.js +38 -21
  82. package/lib/redux/actions/recentTradesActions.test.js +2 -2
  83. package/lib/redux/actions/regionFormActions.test.js +25 -33
  84. package/lib/redux/actions/reportActions.test.js +16 -35
  85. package/lib/redux/actions/signupActions.js +18 -4
  86. package/lib/redux/actions/signupActions.test.js +146 -142
  87. package/lib/redux/actions/snackbarActions.test.js +4 -4
  88. package/lib/redux/actions/tickersActions.test.js +10 -4
  89. package/lib/redux/actions/transferActions.test.js +111 -93
  90. package/lib/redux/actions/transferRequestActions.test.js +42 -42
  91. package/lib/redux/actions/userActions.test.js +539 -305
  92. package/lib/redux/actions/verifyEmailActions.test.js +13 -2
  93. package/lib/redux/actions/withdrawActions.js +99 -65
  94. package/lib/redux/actions/withdrawActions.test.js +163 -154
  95. package/lib/redux/actions/wsConnectionActions.js +96 -1
  96. package/lib/redux/actions/wsConnectionActions.test.js +9 -8
  97. package/lib/redux/actions/wsConnectionLifecycle.test.js +207 -0
  98. package/lib/redux/futures/actions/futuresOrderFormActions.js +26 -2
  99. package/lib/redux/margin/actions/marginActions.test.js +163 -75
  100. package/lib/redux/margin/actions/marginHistoryActions.test.js +190 -151
  101. package/lib/redux/margin/reducers/marginHistoryReducer.test.js +146 -135
  102. package/lib/redux/margin/selectors/marginHistorySelectors.test.js +101 -102
  103. package/lib/redux/margin/selectors/marginOrderSelectors.test.js +2 -2
  104. package/lib/redux/middlewares/authMiddleware.test.js +142 -23
  105. package/lib/redux/middlewares/placeOrderMiddleware.test.js +18 -1
  106. package/lib/redux/middlewares/startupMiddleware.test.js +10 -34
  107. package/lib/redux/middlewares/wsConnectionMiddleware.test.js +6 -1
  108. package/lib/redux/reducers/apiProcessingReducer.test.js +4 -2
  109. package/lib/redux/reducers/authReducer.test.js +3 -3
  110. package/lib/redux/reducers/depositReducer.test.js +2 -1
  111. package/lib/redux/reducers/level2Reducer.test.js +2 -2
  112. package/lib/redux/reducers/orderHistoryReducer.js +1 -1
  113. package/lib/redux/reducers/orderHistoryReducer.test.js +63 -75
  114. package/lib/redux/reducers/positionReducer.test.js +1 -2
  115. package/lib/redux/reducers/resetPasswordReducer.test.js +1 -0
  116. package/lib/redux/reducers/snackbarReducer.test.js +12 -39
  117. package/lib/redux/reducers/tickersReducer.test.js +2 -2
  118. package/lib/redux/reducers/userReducer.test.js +7 -1
  119. package/lib/redux/reducers/withdrawReducer.test.js +11 -5
  120. package/lib/redux/selectors/buySellSelectors.test.js +10 -6
  121. package/lib/redux/selectors/depositWithdrawalSelectors.js +6 -12
  122. package/lib/redux/selectors/instrumentPositionSelectors.test.js +58 -18
  123. package/lib/redux/selectors/level2Selectors.test.js +60 -33
  124. package/lib/redux/selectors/loyaltyTokenSelectors.test.js +15 -13
  125. package/lib/redux/selectors/marginHistorySelectors.test.js +11 -5
  126. package/lib/redux/selectors/openOrdersActivitySelector.test.js +4 -4
  127. package/lib/redux/selectors/orderHistorySelectors.test.js +141 -22
  128. package/lib/redux/selectors/orderTotalSelector.test.js +76 -30
  129. package/lib/redux/selectors/productPositionSelectors.test.js +2 -1
  130. package/lib/redux/selectors/recentTradesSelectors.test.js +17 -0
  131. package/lib/redux/selectors/transfersTableSelectors.test.js +7 -1
  132. package/lib/services/subscriptions/accountPositionSubscriptionService.test.js +0 -14
  133. package/lib/services/subscriptions/orderStateSubscriptionService.test.js +0 -14
  134. package/lib/services/subscriptions/orderTradesSuscriptionService.test.js +0 -14
  135. package/lib/services/tradingView/ChartAPI.js +17 -2
  136. package/lib/setupTests.js +1 -10
  137. package/package.json +21 -5
  138. package/lib/components/APSnackbar/APSnackbarContainer.notest.js +0 -58
  139. package/lib/components/ActivityReportingComponents/ActivityReportingButtons/ActivityReportingButtonsComponent.notest.js +0 -27
  140. package/lib/components/ActivityReportingComponents/ActivityReportingButtons/ActivityReportingButtonsContainer.notest.js +0 -42
  141. package/lib/components/AffiliateComponents/AffiliateActiveTagComponent.notest.js +0 -36
  142. package/lib/components/AffiliateComponents/AffiliateActiveTagContainer.notest.js +0 -81
  143. package/lib/components/AffiliateComponents/AffiliateCountContainer.notest.js +0 -37
  144. package/lib/components/AffiliateComponents/AffiliateModal.notest.js +0 -41
  145. package/lib/components/AffiliateComponents/AffiliateModalContainer.notest.js +0 -79
  146. package/lib/components/ApiKeysSidePaneComponents/ApiKeyList/ApiKeyListContainer.notest.js +0 -40
  147. package/lib/components/ApiKeysSidePaneComponents/ApiKeysComponent/ApiKeysComponent.notest.js +0 -32
  148. package/lib/components/ApiKeysSidePaneComponents/ApiKeysForm/ApiKeysFormComponent.notest.js +0 -32
  149. package/lib/components/ApiKeysSidePaneComponents/ApiKeysForm/ApiKeysFormContainer.notest.js +0 -29
  150. package/lib/components/ApiKeysSidePaneComponents/ApiKeysSidePane/ApiKeySidePaneComponent.notest.js +0 -46
  151. package/lib/components/ApiKeysSidePaneComponents/CreateApiKey/CreateApiKeyComponent.notest.js +0 -50
  152. package/lib/components/ApiKeysSidePaneComponents/CreateApiKey/CreateApiKeyContainer.notest.js +0 -70
  153. package/lib/components/ApiKeysSidePaneComponents/NewApiKey/NewApiKeyModalContainer.notest.js +0 -102
  154. package/lib/components/ApiKeysSidePaneComponents/RemoveApiKeyModal/RemoveApiKeyModalContainer.notest.js +0 -53
  155. package/lib/components/BalancesList/BalancesListContainer.notest.js +0 -91
  156. package/lib/components/BalancesMenu/BalanceMenuContainer.notest.js +0 -49
  157. package/lib/components/BalancesMenu/BalancesMenuComponent.notest.js +0 -68
  158. package/lib/components/BalancesMenu/BalancesMenuItemComponent.notest.js +0 -28
  159. package/lib/components/ConfirmBlockTradeModal/ConfirmBlockTradeModalContainer.notest.js +0 -171
  160. package/lib/components/ConfirmLimitOrderModal/ConfirmLimitOrderModalContainer.notest.js +0 -179
  161. package/lib/components/ConfirmWithdraw/ConfirmWithdrawContainer.notest.js +0 -58
  162. package/lib/components/DepositConfirmation/DepositConfirmationModalContainer.notest.js +0 -59
  163. package/lib/components/DepositSidePaneComponents/DepositFormComponent.notest.js +0 -123
  164. package/lib/components/DepositSidePaneComponents/DepositFormContainer.notest.js +0 -174
  165. package/lib/components/DepositSidePaneComponents/DepositTemplateFormComponent.notest.js +0 -79
  166. package/lib/components/DepositSidePaneComponents/DepositTemplateFormContainer.notest.js +0 -66
  167. package/lib/components/DepositSidePaneComponents/DepositWorkflows/CryptoWalletDepositWorkflow/CryptoWalletDepositWorkflowComponent.notest.js +0 -42
  168. package/lib/components/DepositSidePaneComponents/DepositWorkflows/CryptoWalletDepositWorkflow/CryptoWalletDepositWorkflowContainer.notest.js +0 -52
  169. package/lib/components/DepositSidePaneComponents/DepositWorkflows/DepositWorkflowsComponent.notest.js +0 -52
  170. package/lib/components/DepositSidePaneComponents/DepositWorkflows/DepositWorkflowsContainer.notest.js +0 -49
  171. package/lib/components/DepositSidePaneComponents/DepositWorkflows/GenericPaymentWorkflow/GenericPaymentWorkflowComponent.notest.js +0 -96
  172. package/lib/components/DepositSidePaneComponents/DepositWorkflows/GenericPaymentWorkflow/GenericPaymentWorkflowContainer.notest.js +0 -49
  173. package/lib/components/DepositSidePaneComponents/DepositWorkflows/ManualDepositWorkflow/ManualDepositWorkflowComponent.notest.js +0 -68
  174. package/lib/components/DepositSidePaneComponents/DepositWorkflows/ManualDepositWorkflow/ManualDepositWorkflowContainer.notest.js +0 -60
  175. package/lib/components/DepositSidePaneComponents/DepositWorkflows/PaymentProcessors/Hyphen/HyphenDepositWorkflowContainer.notest.js +0 -66
  176. package/lib/components/DepthChart/DepthChartContainer.notest.js +0 -82
  177. package/lib/components/EnableTwoFactorAuth/Disable2FAModalContainer.notest.js +0 -73
  178. package/lib/components/EnableTwoFactorAuth/Enable2FAModalContainer.notest.js +0 -82
  179. package/lib/components/EnableTwoFactorAuth/EnableTwoFactorAuthContainerFactory.notest.js +0 -50
  180. package/lib/components/EotcBalancesList/EotcBalancesListContainer.notest.js +0 -53
  181. package/lib/components/EotcProductCard/EotcProductCardContainer.notest.js +0 -87
  182. package/lib/components/EotcProductCard/EotcProductCardListContainer.notest.js +0 -55
  183. package/lib/components/EotcProductCardSimple/EotcProductCardSimpleContainer.notest.js +0 -136
  184. package/lib/components/EotcProductCardSimple/EotcProductCardSimpleListContainer.notest.js +0 -66
  185. package/lib/components/EotcWalletCard/EotcWalletCardContainer.notest.js +0 -148
  186. package/lib/components/EotcWalletCard/EotcWalletCardGridContainer.notest.js +0 -57
  187. package/lib/components/InstrumentPositions/InstrumentPositionsContainer.notest.js +0 -54
  188. package/lib/components/InstrumentPositionsWrapper/InstrumentPositionsWrapperContainer.notest.js +0 -46
  189. package/lib/components/InstrumentSelector/InstrumentSelectorContainer.notest.js +0 -112
  190. package/lib/components/InstrumentTable/InstrumentTableContainer.notest.js +0 -51
  191. package/lib/components/KYC/KYCBaseContainer.notest.js +0 -103
  192. package/lib/components/KYC/KYCLevel/KYCLevelComponent.notest.js +0 -94
  193. package/lib/components/KYCSettings/KYCSettingsContainer.notest.js +0 -49
  194. package/lib/components/KYCStatus/KYCStatusContainer.notest.js +0 -66
  195. package/lib/components/KYC_IM/KYC_IMForm/KYC_IMFormContainer.notest.js +0 -89
  196. package/lib/components/KYC_IM/KYC_IMForm/KYC_IMFormStepContainer.notest.js +0 -37
  197. package/lib/components/KYC_IM/KYC_IMLevelsContainer.notest.js +0 -47
  198. package/lib/components/KYC_IMLegacy/KYC_IMLegacyForm/KYC_IMLegacyFormContainer.notest.js +0 -152
  199. package/lib/components/KYC_IMLegacy/KYC_IMLegacyLevelsContainer.notest.js +0 -47
  200. package/lib/components/KYC_Jumio/KYC_JumioIframe/KYC_JumioIframeComponent.notest.js +0 -63
  201. package/lib/components/KYC_Jumio/KYC_JumioIframe/KYC_JumioIframeContainer.notest.js +0 -70
  202. package/lib/components/KYC_Jumio/KYC_JumioLevelsContainer.notest.js +0 -47
  203. package/lib/components/KYC_Manual/KYC_ManualForm/KYC_ManualFormContainer.notest.js +0 -102
  204. package/lib/components/KYC_Manual/KYC_ManualIframe/KYC_ManualIframeContainer.notest.js +0 -150
  205. package/lib/components/KYC_Manual/KYC_ManualLevelsContainer.notest.js +0 -47
  206. package/lib/components/Login/LoginFormComponent.notest.js +0 -84
  207. package/lib/components/Login/LoginFormContainer.notest.js +0 -111
  208. package/lib/components/LoyaltyToken/LoyaltyTokenContainer.notest.js +0 -57
  209. package/lib/components/MarginBalances/MarginDepositWithdraw/MarginDepositModal/MarginDepositFormContainer.notest.js +0 -87
  210. package/lib/components/MarginBalances/MarginDepositWithdraw/MarginDepositWithdrawContainer.notest.js +0 -83
  211. package/lib/components/MarginBalances/MarginOverview/MarginOverviewContainer.notest.js +0 -45
  212. package/lib/components/MarginTransferAssetModal/MarginTransferAssetsFormContainer.notest.js +0 -194
  213. package/lib/components/MarketDataCardsComponent/MarketDataCardsContainer.notest.js +0 -63
  214. package/lib/components/MenuItem/MenuItemComponent.notest.js +0 -39
  215. package/lib/components/OrderBookComponents/BulkCancelButtonsComponent/BulkCancelButtonsComponent.notest.js +0 -54
  216. package/lib/components/OrderBookComponents/Level2DataTableComponent.notest.js +0 -38
  217. package/lib/components/OrderBookComponents/OrderBookComponent.notest.js +0 -38
  218. package/lib/components/OrderBookComponents/OrderBookContainer.notest.js +0 -121
  219. package/lib/components/OrderHistoryComponents/DepositsStatus/DepositsStatusComponent.notest.js +0 -68
  220. package/lib/components/OrderHistoryComponents/FilledOrders/FilledOrdersComponent.notest.js +0 -156
  221. package/lib/components/OrderHistoryComponents/HeaderWithFilter/HeaderWithFilterContainer.notest.js +0 -58
  222. package/lib/components/OrderHistoryComponents/InactiveOrders/InactiveOrdersComponent.notest.js +0 -97
  223. package/lib/components/OrderHistoryComponents/MarginOpenPositions/MarginOpenPositionsComponent.notest.js +0 -93
  224. package/lib/components/OrderHistoryComponents/MarginOrderHistory/MarginOrderHistoryComponent.notest.js +0 -107
  225. package/lib/components/OrderHistoryComponents/MarginOrderHistoryExtended/MarginOrderHistoryExtendedComponent.notest.js +0 -118
  226. package/lib/components/OrderHistoryComponents/OpenOrders/OpenOrdersComponent.notest.js +0 -123
  227. package/lib/components/OrderHistoryComponents/OrderHistoryComponent.notest.js +0 -107
  228. package/lib/components/OrderHistoryComponents/PositionPayments/PositionPaymentsComponent.notest.js +0 -82
  229. package/lib/components/OrderHistoryComponents/TradeReports/TradeReportsComponent.notest.js +0 -124
  230. package/lib/components/OrderHistoryComponents/WithdrawStatus/WithdrawStatusComponent.notest.js +0 -69
  231. package/lib/components/PriceChart/ApexChartComponent.notest.js +0 -48
  232. package/lib/components/PriceChart/ApexChartContainer.notest.js +0 -75
  233. package/lib/components/PriceChart/PriceChartContainer.notest.js +0 -37
  234. package/lib/components/PriceChart/TVChartContainer.notest.js +0 -106
  235. package/lib/components/ProblemLoggingIn/ProblemLoggingInFormContainer.notest.js +0 -81
  236. package/lib/components/ProductPositionDetails/ProductPositionDetailsComponent.notest.js +0 -37
  237. package/lib/components/ProductPositionDetails/ProductPositionDetailsContainer.notest.js +0 -47
  238. package/lib/components/ProfileForm/ProfileFormComponent.notest.js +0 -51
  239. package/lib/components/ProfileForm/ProfileFormContainer.notest.js +0 -68
  240. package/lib/components/RecentActivity/RecentActivityContainer.notest.js +0 -41
  241. package/lib/components/RecentActivity/RecentActivityTable/RecentActivityTableContainer.notest.js +0 -43
  242. package/lib/components/RecentActivityWithFilter/RecentActivityHeaderWithFilter/RecentActivityHeaderForm/RecentActivityHeaderFormContainer.notest.js +0 -128
  243. package/lib/components/RecentActivityWithFilter/RecentActivityTableWithFilter/RecentActivityTableWithFilterContainer.notest.js +0 -64
  244. package/lib/components/RecentActivityWithFilter/RecentActivityWithFilterContainer.notest.js +0 -41
  245. package/lib/components/RecentTrades/RecentTradesComponent.notest.js +0 -78
  246. package/lib/components/RecentTrades/RecentTradesContainer.notest.js +0 -59
  247. package/lib/components/ReportBlockTradeSidePaneComponents/ReportBlockTradeContainer.notest.js +0 -169
  248. package/lib/components/ReportBlockTradeSidePaneComponents/ReportBlockTradeSidePaneContainer.notest.js +0 -107
  249. package/lib/components/ReportSidePaneComponents/ConfirmCyclicalReport/ConfirmCyclicalReportModalContainer.notest.js +0 -39
  250. package/lib/components/ReportSidePaneComponents/ConfirmSingleReport/ConfirmSingleReportModalContainer.notest.js +0 -39
  251. package/lib/components/ReportSidePaneComponents/CreateReportForm/CreateReportFormComponent.notest.js +0 -42
  252. package/lib/components/ReportSidePaneComponents/CreateReportForm/CreateReportFormContainer.notest.js +0 -85
  253. package/lib/components/ReportSidePaneComponents/DownloadReportForm/DownloadReportContainer.notest.js +0 -37
  254. package/lib/components/ReportSidePaneComponents/ReportSidePaneComponent.notest.js +0 -72
  255. package/lib/components/ReportSidePaneComponents/ScheduleReportForm/ScheduleReportFormComponent.notest.js +0 -43
  256. package/lib/components/ReportSidePaneComponents/ScheduleReportForm/ScheduleReportFormContainer.notest.js +0 -80
  257. package/lib/components/ReportSidePaneComponents/ScheduledReportsTable/ScheduledReportsTableComponent.notest.js +0 -34
  258. package/lib/components/ReportSidePaneComponents/ScheduledReportsTable/ScheduledReportsTableContainer.notest.js +0 -48
  259. package/lib/components/ResetPasswordForm/ResetPasswordFormContainer.notest.js +0 -105
  260. package/lib/components/ResetPasswordRequestForm/ResetPasswordRequestFormComponent.notest.js +0 -39
  261. package/lib/components/ResetPasswordRequestForm/ResetPasswordRequestFormContainerFactory.notest.js +0 -47
  262. package/lib/components/Retail/RetailBuySell/BuySell/BuySellContainer.notest.js +0 -105
  263. package/lib/components/Retail/RetailBuySell/BuySell/BuySellCustomRow/BuySellCustomRowContainer.notest.js +0 -145
  264. package/lib/components/Retail/RetailBuySell/BuySell/BuySellInstrumentSelector/BuySellInstrumentSelectorContainer.notest.js +0 -113
  265. package/lib/components/Retail/RetailBuySell/BuySell/BuySellOrderButton/BuySellOrderButtonContainer.notest.js +0 -66
  266. package/lib/components/Retail/RetailBuySell/BuySell/BuySellPresetValuesRows/BuySellPresetValuesRowsContainer.notest.js +0 -125
  267. package/lib/components/Retail/RetailBuySell/BuySell/BuySellTabs/BuySellTabsContainer.notest.js +0 -115
  268. package/lib/components/Retail/RetailBuySell/BuySellBalances/BuySellBalancesContainer.notest.js +0 -126
  269. package/lib/components/Retail/RetailBuySell/BuySellChartIntervalSelector/BuySellChartIntervalSelectorContainer.notest.js +0 -36
  270. package/lib/components/Retail/RetailBuySell/BuySellChartOverview/BuySellChartOverviewContainer.notest.js +0 -43
  271. package/lib/components/Retail/RetailBuySell/BuySellInstrumentSelect/BuySellInstrumentSelectContainer.notest.js +0 -153
  272. package/lib/components/Retail/RetailBuySell/BuySellOrderConfirmationModal/BuySellConfirmationModalContainer.notest.js +0 -262
  273. package/lib/components/Retail/RetailBuySell/BuySellOrderOverview/BuySellOrderOverviewContainer.notest.js +0 -124
  274. package/lib/components/Retail/RetailBuySell/EotcBuySell/EotcBuySellContainer.notest.js +0 -125
  275. package/lib/components/Retail/RetailBuySell/EotcBuySell/EotcBuySellCustomRow/EotcBuySellCustomRowContainer.notest.js +0 -143
  276. package/lib/components/Retail/RetailBuySell/EotcBuySell/EotcBuySellPresetValuesRows/EotcBuySellPresetValuesRowsContainer.notest.js +0 -125
  277. package/lib/components/Retail/RetailBuySell/EotcBuySellChartOverviewContainer/BuySellChartOverviewContainer.notest.js +0 -43
  278. package/lib/components/Retail/RetailBuySell/EotcBuySellOrderConfirmationModal/EotcBuySellConfirmationModalContainer.notest.js +0 -262
  279. package/lib/components/Retail/RetailSidePanes/FiatDeposit/DepositReferenceIdModalContainer.notest.js +0 -45
  280. package/lib/components/Retail/RetailSidePanes/FiatDeposit/FiatDepositFormContainer.notest.js +0 -137
  281. package/lib/components/Retail/RetailSidePanes/FiatDeposit/FiatDepositModalContainer.notest.js +0 -82
  282. package/lib/components/Retail/RetailSidePanes/FiatFormTabsComponent.notest.js +0 -49
  283. package/lib/components/Retail/RetailSidePanes/FiatSidePaneContainer.notest.js +0 -62
  284. package/lib/components/Retail/RetailSidePanes/FiatWithdraw/BankSelect/BankSelectContainer.notest.js +0 -80
  285. package/lib/components/Retail/RetailSidePanes/FiatWithdraw/FiatWithdrawFormContainer.notest.js +0 -124
  286. package/lib/components/Retail/RetailSidePanes/FiatWithdraw/FiatWithdrawModalContainer.notest.js +0 -46
  287. package/lib/components/SendReceiveSidePane/Receive/ReceiveContainer.notest.js +0 -69
  288. package/lib/components/SendReceiveSidePane/ReceiveAddress/ReceiveAddressContainer.notest.js +0 -73
  289. package/lib/components/SendReceiveSidePane/ReceiveForm/ReceiveFormContainer.notest.js +0 -54
  290. package/lib/components/SendReceiveSidePane/SendAddress/SendAddressContainer.notest.js +0 -71
  291. package/lib/components/SendReceiveSidePane/SendForm/SendFormContainer.notest.js +0 -72
  292. package/lib/components/SendReceiveSidePane/SendReceiveSidePaneContainer.notest.js +0 -139
  293. package/lib/components/SendReceiveSidePane/SendReceiveTwoFactorAuth/SendReceiveTwoFactorAuthContainer.notest.js +0 -102
  294. package/lib/components/Settings/ApiKeys/ApiKeysSidePaneButton/ApiKeysSidePaneButtonContainer.notest.js +0 -31
  295. package/lib/components/Settings/DemoSettings/DemoSettingsContainer.notest.js +0 -46
  296. package/lib/components/Settings/ProfileAndSecurity/ProfileSettingsCard/ProfileForm/ProfileFormContainer.notest.js +0 -69
  297. package/lib/components/Settings/ProfileAndSecurity/RegionSettingsCard/RegionSettings/RegionSettingsContainer.notest.js +0 -86
  298. package/lib/components/Settings/ProfileAndSecurity/ThemeSettingsCard/ThemeForm/ThemeSettingsContainer.notest.js +0 -45
  299. package/lib/components/Settings/TradeSettings/MarginTrading/EnableMarginModal/EnableMarginConfirmationModalComponent.notest.js +0 -47
  300. package/lib/components/Settings/TradeSettings/MarginTrading/EnableMarginModal/EnableMarginConfirmationModalContainer.notest.js +0 -112
  301. package/lib/components/Settings/TradeSettings/MarginTrading/MarginTradingComponent.notest.js +0 -33
  302. package/lib/components/Settings/TradeSettings/MarginTrading/MarginTradingContainer.notest.js +0 -54
  303. package/lib/components/Settings/TransferHistory/TransferHistoryContainer.notest.js +0 -42
  304. package/lib/components/Signup/SignupFormComponent.notest.js +0 -92
  305. package/lib/components/Signup/SignupFormContainer.notest.js +0 -124
  306. package/lib/components/StandaloneKYC/StandaloneKYCContainer.notest.js +0 -75
  307. package/lib/components/StandaloneModal/StandaloneModalComponent.notest.js +0 -69
  308. package/lib/components/Ticker/TickerContainer.notest.js +0 -57
  309. package/lib/components/Transfers/TransfersContainer.notest.js +0 -99
  310. package/lib/components/Transfers/TransfersFilters/TransfersFiltersContainer.notest.js +0 -81
  311. package/lib/components/TwoFactorAuthForm/TwoFactorAuthFormContainer.notest.js +0 -60
  312. package/lib/components/UserBalance/UserBalanceContainer.notest.js +0 -47
  313. package/lib/components/UserSettings/UserSettingsComponent.notest.js +0 -55
  314. package/lib/components/UserSummary/UserSummaryContainer.notest.js +0 -65
  315. package/lib/components/VerificationRequired/VerificationRequiredContainer.notest.js +0 -47
  316. package/lib/components/VerifyEmail/VerifyEmailContainer.notest.js +0 -46
  317. package/lib/components/WalletCards/WalletCardContainer.notest.js +0 -77
  318. package/lib/components/WalletCards/WalletCardGridContainer.notest.js +0 -42
  319. package/lib/components/WalletDetails/WalletDetailsContainer.notest.js +0 -61
  320. package/lib/components/WalletNavItems/CryptoNavItemsContainer.notest.js +0 -46
  321. package/lib/components/WalletNavItems/EotcCryptoNavItemsContainer.notest.js +0 -64
  322. package/lib/components/WalletNavItems/FiatNavItemsComponent.notest.js +0 -59
  323. package/lib/components/WalletNavItems/FiatNavItemsContainer.notest.js +0 -66
  324. package/lib/components/WalletRows/WalletRowContainer.notest.js +0 -76
  325. package/lib/components/WalletRows/WalletRowListContainer.notest.js +0 -43
  326. package/lib/components/WithdrawSidePaneComponents/PaymentProcessors/HyphenWithdrawWorkflowContainer.notest.js +0 -51
  327. package/lib/components/WithdrawSidePaneComponents/PaymentProcessors/TrustpayWithdrawWorkflowContainer.notest.js +0 -36
  328. package/lib/components/WithdrawSidePaneComponents/WithdrawForm/WithdrawFormComponent.notest.js +0 -131
  329. package/lib/components/WithdrawSidePaneComponents/WithdrawForm/WithdrawFormContainer.notest.js +0 -140
  330. package/lib/components/WithdrawSidePaneComponents/WithdrawTemplateForm/WithdrawTemplateFormComponent.notest.js +0 -38
  331. package/lib/components/WithdrawSidePaneComponents/WithdrawTemplateForm/WithdrawTemplateFormContainer.notest.js +0 -95
  332. package/lib/components/WithdrawSidePaneComponents/WithdrawWorkflows/WithdrawWorkflowsContainer.notest.js +0 -42
  333. package/lib/components/common/APDatePicker/APDatePicker.notest.js +0 -194
  334. package/lib/components/common/APLabelWithText/APLabelWithText.notest.js +0 -25
  335. package/lib/components/common/APNumberInput.notest.js +0 -173
  336. package/lib/components/common/APRadioTab/APRadioTab.notest.js +0 -69
  337. package/lib/components/common/APSegmentedButton/APSegmentedButton.notest.js +0 -55
  338. package/lib/components/common/APSnackbar/APSnackbar.notest.js +0 -107
  339. package/lib/components/common/APVerticalScroller/APVerticalScroller.notest.js +0 -172
  340. package/lib/components/common/Modal/Modal.notest.js +0 -55
  341. package/lib/components/common/Pagination/PaginationComponent.notest.js +0 -137
  342. package/lib/components/common/Pagination/PaginationContainer.notest.js +0 -47
  343. package/lib/components/common/Popover/Popover.notest.js +0 -137
  344. package/lib/components/common/ProductIcon/ProductIcon.notest.js +0 -76
  345. package/lib/components/common/ProductIcon/ProductIconContainer.notest.js +0 -38
  346. package/lib/components/common/SidePane/SidePaneComponent.notest.js +0 -48
  347. package/lib/components/common/SidePane/SidePaneContainer.notest.js +0 -54
  348. package/lib/components/common/Snackbar/Snackbar.notest.js +0 -51
  349. package/lib/components/common/Tab/Tab.notest.js +0 -68
  350. package/lib/helpers/formGeneratorHelper.notest.js +0 -203
  351. package/lib/helpers/formTemplateHelper.notest.js +0 -170
  352. package/lib/hocs/modalDecorator.notest.js +0 -74
  353. package/lib/hocs/redirectIfAuthorized.notest.js +0 -80
  354. package/lib/hocs/resize.notest.js +0 -37
  355. package/lib/layouts/HomePageLayout.notest.js +0 -65
  356. package/lib/redux/actions/languageActions.test.js +0 -105
  357. 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 _apex = _interopRequireDefault(require("../../apex"));
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
- jest.mock('../../apex', function () {
44
- var returnValue = null;
45
- var returnRPCPromiseValue = null;
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
- connection: {
48
- RPCPromise: jest.fn().mockImplementation(function () {
49
- return returnRPCPromiseValue;
50
- }),
51
- GetDepositRequestInfoTemplate: jest.fn(function () {
52
- return Promise.resolve(returnValue);
53
- }),
54
- GetDepositInfo: jest.fn(function () {
55
- return Promise.resolve(returnValue);
56
- }),
57
- CreateDepositTicket: jest.fn(function () {
58
- return Promise.resolve(returnValue);
59
- }),
60
- GetDepositTickets: jest.fn(function () {
61
- return Promise.resolve(returnValue);
62
- }),
63
- setReturnValue: function setReturnValue(value) {
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
- _apex["default"].connection.setRPCPromiseReturnValue(Promise.resolve({
119
- o: JSON.stringify({
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 apex.connection.RPCPromise with expected params', function () {
161
+ it('should call callAPI with expected params', function () {
154
162
  store.dispatch(actions.fetchAllProductDepositTemplates(2));
155
- expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('GetDepositTemplateTypes', {
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 call GetDepositRequestInfoTemplate if only one template exists for product', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
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
- templateType: 'Standard'
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(2));
212
+ return store.dispatch(actions.fetchAllProductDepositTemplates(1));
215
213
  case 1:
216
- expect(store.getActions()[1].type).toEqual(actions.RECEIVE_DEPOSIT_TEMPLATES_ERROR);
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 response result is false"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
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
- _apex["default"].connection.setRPCPromiseReturnValue({
227
- o: JSON.stringify({
228
- result: false,
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 call fetchProductDepositTemplate if response is rejected", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
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
- _apex["default"].connection.setRPCPromiseReturnValue(Promise.reject());
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].type).toEqual(actions.FETCH_PRODUCT_DEPOSIT_TEMPLATE);
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 apex', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
264
- return _regenerator().w(function (_context6) {
265
- while (1) switch (_context6.n) {
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
- _apex["default"].connection.setReturnValue({
281
+ apiActions.setReturnValue('GetDepositRequestInfoTemplate', {
268
282
  depositTemplate: {}
269
283
  });
270
- _context6.n = 1;
284
+ _context7.n = 1;
271
285
  return store.dispatch(actions.fetchProductDepositTemplate(1));
272
286
  case 1:
273
- expect(_apex["default"].connection.GetDepositRequestInfoTemplate).toHaveBeenCalledWith({
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 _context6.a(2);
293
+ return _context7.a(2);
280
294
  }
281
- }, _callee6);
295
+ }, _callee7);
282
296
  })));
283
- it('should call GetDepositRequestInfoTemplate from apex with correct params', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
284
- var params, store;
285
- return _regenerator().w(function (_context7) {
286
- while (1) switch (_context7.n) {
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
- _apex["default"].connection.setReturnValue({
306
+ apiActions.setReturnValue('GetDepositRequestInfoTemplate', {
289
307
  depositTemplate: {}
290
308
  });
291
- params = {
292
- templateType: 'Standart',
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(_apex["default"].connection.GetDepositRequestInfoTemplate).toHaveBeenCalledWith({
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 _context7.a(2);
319
+ return _context8.a(2);
311
320
  }
312
- }, _callee7);
321
+ }, _callee8);
313
322
  })));
314
- it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATE, " action on successful response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
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 (_context8) {
317
- while (1) switch (_context8.n) {
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
- _apex["default"].connection.setReturnValue(template);
326
- _context8.n = 1;
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 _context8.a(2);
343
+ return _context9.a(2);
335
344
  }
336
- }, _callee8);
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 _callee9() {
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 (_context9) {
341
- while (1) switch (_context9.n) {
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
- _apex["default"].connection.setReturnValue(template);
350
- _context9.n = 1;
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 _context9.a(2);
367
+ return _context0.a(2);
359
368
  }
360
- }, _callee9);
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 _callee0() {
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 (_context0) {
365
- while (1) switch (_context0.n) {
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
- _apex["default"].connection.setReturnValue(template);
376
- _context0.n = 1;
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 _context0.a(2);
395
+ return _context1.a(2);
387
396
  }
388
- }, _callee0);
397
+ }, _callee1);
389
398
  })));
390
- it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TEMPLATE_ERROR, " action on failed response"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
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 (_context1) {
393
- while (1) switch (_context1.n) {
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
- _apex["default"].connection.setReturnValue(template);
400
- _context1.n = 1;
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 _context1.a(2);
417
+ return _context10.a(2);
409
418
  }
410
- }, _callee1);
419
+ }, _callee10);
411
420
  })));
412
- it("should dispatch ".concat(actions.RESET_DEPOSIT_INFO, " action if ProductId is NaN"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
413
- return _regenerator().w(function (_context10) {
414
- while (1) switch (_context10.n) {
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
- _context10.n = 1;
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 _context10.a(2);
432
+ return _context11.a(2);
424
433
  }
425
- }, _callee10);
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 _callee11() {
430
- return _regenerator().w(function (_context11) {
431
- while (1) switch (_context11.n) {
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
- _apex["default"].connection.setReturnValue({
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 _context11.a(2);
449
+ return _context12.a(2);
444
450
  }
445
- }, _callee11);
451
+ }, _callee12);
446
452
  })));
447
- it("should dispatch createDepositTicket", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
448
- return _regenerator().w(function (_context12) {
449
- while (1) switch (_context12.n) {
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
- _context12.n = 1;
463
+ _context13.n = 1;
455
464
  return store.dispatch(actions.createDepositTicket({}));
456
465
  case 1:
457
- expect(_apex["default"].connection.CreateDepositTicket).toHaveBeenCalled();
466
+ expect(apiActions.callAPI).toHaveBeenCalledWith('CreateDepositTicket', expect.any(Object));
458
467
  case 2:
459
- return _context12.a(2);
468
+ return _context13.a(2);
460
469
  }
461
- }, _callee12);
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 _callee13() {
465
- return _regenerator().w(function (_context13) {
466
- while (1) switch (_context13.n) {
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
- store = getStoreMock();
469
- _context13.n = 1;
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 _context13.a(2);
488
+ return _context14.a(2);
475
489
  }
476
- }, _callee13);
490
+ }, _callee14);
477
491
  })));
478
- it('should NOT show snackbar if config.Deposit.showDepositIdModal == true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
479
- return _regenerator().w(function (_context14) {
480
- while (1) switch (_context14.n) {
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
- jest.mock('../../config', function () {
485
- return {
486
- Deposit: {
487
- generateNewKey: false,
488
- showDepositIdModal: true
489
- }
490
- };
501
+ store = getStoreMock({
502
+ UseGetDepositWorkflow: false
491
503
  });
492
- _context14.n = 1;
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 _context14.a(2);
510
+ return _context15.a(2);
498
511
  }
499
- }, _callee14);
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 from apex', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
508
- return _regenerator().w(function (_context15) {
509
- while (1) switch (_context15.n) {
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
- _apex["default"].connection.setReturnValue({
524
+ apiActions.setReturnValue('GetDepositInfo', {
512
525
  DepositInfo: '[]'
513
526
  });
514
- _context15.n = 1;
527
+ _context16.n = 1;
515
528
  return store.dispatch(actions.getDepositInfo(1));
516
529
  case 1:
517
- expect(_apex["default"].connection.GetDepositInfo).toHaveBeenCalledWith({
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 _context15.a(2);
537
+ return _context16.a(2);
525
538
  }
526
- }, _callee15);
539
+ }, _callee16);
527
540
  })));
528
- it('should call GetDepositInfo from apex with correct params', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16() {
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 (_context16) {
531
- while (1) switch (_context16.n) {
543
+ return _regenerator().w(function (_context17) {
544
+ while (1) switch (_context17.n) {
532
545
  case 0:
533
- _apex["default"].connection.setReturnValue({
546
+ apiActions.setReturnValue('GetDepositInfo', {
534
547
  DepositInfo: '[]'
535
548
  });
536
549
  params = {
537
- templateType: 'Standart',
550
+ AccountProviderId: 1,
538
551
  templateTypes: [{
539
552
  TemplateName: 'Standart',
540
553
  AccountProviderId: 1
541
554
  }]
542
555
  };
543
556
  store = getStoreMock({}, params);
544
- _context16.n = 1;
557
+ _context17.n = 1;
545
558
  return store.dispatch(actions.getDepositInfo(1));
546
559
  case 1:
547
- expect(_apex["default"].connection.GetDepositInfo).toHaveBeenCalledWith({
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 _context16.a(2);
568
+ return _context17.a(2);
556
569
  }
557
- }, _callee16);
570
+ }, _callee17);
558
571
  })));
559
- it('should forward an explicit generateNewKey override to GetDepositInfo', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
560
- return _regenerator().w(function (_context17) {
561
- while (1) switch (_context17.n) {
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
- _apex["default"].connection.setReturnValue({
576
+ apiActions.setReturnValue('GetDepositInfo', {
564
577
  DepositInfo: '[]'
565
578
  });
566
- _context17.n = 1;
579
+ _context18.n = 1;
567
580
  return store.dispatch(actions.getDepositInfo(1, undefined, undefined, true));
568
581
  case 1:
569
- expect(_apex["default"].connection.GetDepositInfo).toHaveBeenCalledWith({
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 _context17.a(2);
589
+ return _context18.a(2);
577
590
  }
578
- }, _callee17);
591
+ }, _callee18);
579
592
  })));
580
- it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_INFO, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18() {
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 (_context18) {
583
- while (1) switch (_context18.n) {
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
- _apex["default"].connection.setReturnValue(depositInfo);
590
- _context18.n = 1;
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 _context18.a(2);
611
+ return _context19.a(2);
599
612
  }
600
- }, _callee18);
613
+ }, _callee19);
601
614
  })));
602
- it("should dispatch ".concat(actions.RESET_DEPOSIT_INFO, " action if ProductId is NaN"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19() {
603
- return _regenerator().w(function (_context19) {
604
- while (1) switch (_context19.n) {
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
- _context19.n = 1;
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(_apex["default"].connection.GetDepositInfo).not.toHaveBeenCalled();
625
+ expect(apiActions.callAPI).not.toHaveBeenCalled();
613
626
  case 2:
614
- return _context19.a(2);
627
+ return _context20.a(2);
615
628
  }
616
- }, _callee19);
629
+ }, _callee20);
617
630
  })));
618
631
  });
619
632
  describe('getDepositTickets action', function () {
620
- it('should call getDepositTickets from apex', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20() {
621
- return _regenerator().w(function (_context20) {
622
- while (1) switch (_context20.n) {
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
- _context20.n = 1;
640
+ _context21.n = 1;
625
641
  return store.dispatch(actions.getDepositTickets());
626
642
  case 1:
627
- expect(_apex["default"].connection.GetDepositTickets).toHaveBeenCalledWith({
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 _context20.a(2);
650
+ return _context21.a(2);
634
651
  }
635
- }, _callee20);
652
+ }, _callee21);
636
653
  })));
637
- it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TICKETS, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21() {
638
- return _regenerator().w(function (_context21) {
639
- while (1) switch (_context21.n) {
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
- _apex["default"].connection.setReturnValue([]);
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 _context21.a(2);
666
+ return _context22.a(2);
651
667
  }
652
- }, _callee21);
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 from apex', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22() {
678
+ it('should call CreateDepositTicket via callAPI', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
662
679
  var depositInfoPayload;
663
- return _regenerator().w(function (_context22) {
664
- while (1) switch (_context22.n) {
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
- _apex["default"].connection.setReturnValue({
687
+ apiActions.setReturnValue('CreateDepositTicket', {
671
688
  success: true,
672
689
  requestCode: 'abcd-efgh-1234-5678'
673
690
  });
674
- _context22.n = 1;
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(_apex["default"].connection.CreateDepositTicket).toHaveBeenCalledWith({
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 _context22.a(2);
710
+ return _context23.a(2);
694
711
  }
695
- }, _callee22);
712
+ }, _callee23);
696
713
  })));
697
714
  });
698
- it("should dispatch ".concat(actions.RECEIVE_DEPOSIT_TICKET, " action"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
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 (_context23) {
701
- while (1) switch (_context23.n) {
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
- _apex["default"].connection.setReturnValue(createTicketResponse);
711
- _context23.n = 1;
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 _context23.a(2);
742
+ return _context24.a(2);
725
743
  }
726
- }, _callee23);
744
+ }, _callee24);
727
745
  })));
728
- it("should call showSnack if response result is false", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
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 (_context24) {
731
- while (1) switch (_context24.n) {
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
- _apex["default"].connection.setReturnValue(createTicketResponse);
740
- _context24.n = 1;
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 _context24.a(2);
768
+ return _context25.a(2);
751
769
  }
752
- }, _callee24);
770
+ }, _callee25);
753
771
  })));
754
772
  describe('subscribeToDeposits', function () {
755
- it('should call subscribeToDeposits', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25() {
756
- return _regenerator().w(function (_context25) {
757
- while (1) switch (_context25.n) {
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
- _context25.n = 1;
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 _context25.a(2);
782
+ return _context26.a(2);
765
783
  }
766
- }, _callee25);
784
+ }, _callee26);
767
785
  })));
768
- it("should dispatch ".concat(actions.ADD_DEPOSIT, " action with update when subscribed"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26() {
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 (_context26) {
771
- while (1) switch (_context26.n) {
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
- _context26.n = 1;
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 _context26.a(2);
802
+ return _context27.a(2);
785
803
  }
786
- }, _callee26);
804
+ }, _callee27);
787
805
  })));
788
806
  });
789
807
  });