@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
@@ -8,15 +8,23 @@ var _apex = _interopRequireDefault(require("../../apex"));
8
8
  var orderHistoryActions = _interopRequireWildcard(require("./orderHistoryActions"));
9
9
  var snackbarActions = _interopRequireWildcard(require("./snackbarActions"));
10
10
  var positionActions = _interopRequireWildcard(require("./positionActions"));
11
- var depositActions = _interopRequireWildcard(require("./depositActions"));
12
11
  var withdrawActions = _interopRequireWildcard(require("./withdrawActions"));
13
12
  var transferActions = _interopRequireWildcard(require("./transferActions"));
14
13
  var _modalActions = require("./modalActions");
15
14
  var _verificationLevelUpdateService = _interopRequireDefault(require("../../services/subscriptions/verificationLevelUpdateService"));
16
15
  var _config = _interopRequireDefault(require("../../config"));
16
+ var _excluded = ["ResendVerificationEmail"];
17
17
  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); }
18
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
19
19
  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); }
20
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
21
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
22
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
23
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
25
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
26
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
27
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
20
28
  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 }; })(); }
21
29
  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); }
22
30
  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); }
@@ -28,7 +36,22 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
28
36
  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); }
29
37
  var middlewares = [_reduxThunk["default"]];
30
38
  var mockStore = (0, _reduxMockStore["default"])(middlewares);
31
- var dispatchStub = jest.fn();
39
+ var dispatchStub = jest.fn(function (action) {
40
+ if (typeof action === 'function') {
41
+ return action(dispatchStub, function () {
42
+ return {
43
+ api: {
44
+ validate2FARequiredEndpoints: {}
45
+ },
46
+ user: {
47
+ accounts: [],
48
+ userInfo: {}
49
+ }
50
+ };
51
+ });
52
+ }
53
+ return action;
54
+ });
32
55
  jest.mock('../../apex', function () {
33
56
  var response;
34
57
  var getAccountInfoResponse;
@@ -37,7 +60,8 @@ jest.mock('../../apex', function () {
37
60
  // eslint-disable-next-line no-unused-vars
38
61
  var getUserConfigResponse;
39
62
  var returnRPCPromiseValue;
40
- return {
63
+ var rpcPromiseResponsesByEndpoint = {};
64
+ var apexMock = {
41
65
  connection: {
42
66
  GetUserInfo: jest.fn().mockImplementation(function () {
43
67
  return getUserInfoResponse;
@@ -93,14 +117,29 @@ jest.mock('../../apex', function () {
93
117
  setGetUserConfigResponse: function setGetUserConfigResponse(res) {
94
118
  getUserConfigResponse = res;
95
119
  },
96
- RPCPromise: jest.fn().mockImplementation(function () {
120
+ RPCPromise: jest.fn().mockImplementation(function (endpoint) {
121
+ if (Object.prototype.hasOwnProperty.call(rpcPromiseResponsesByEndpoint, endpoint)) {
122
+ return rpcPromiseResponsesByEndpoint[endpoint];
123
+ }
97
124
  return returnRPCPromiseValue;
98
125
  }),
99
126
  setRPCPromiseReturnValue: function setRPCPromiseReturnValue(value) {
100
127
  returnRPCPromiseValue = value;
101
- }
128
+ },
129
+ setRPCPromiseReturnValueForEndpoint: function setRPCPromiseReturnValueForEndpoint(endpoint, value) {
130
+ rpcPromiseResponsesByEndpoint[endpoint] = value;
131
+ },
132
+ resetRPCPromiseResponses: function resetRPCPromiseResponses() {
133
+ returnRPCPromiseValue = undefined;
134
+ rpcPromiseResponsesByEndpoint = {};
135
+ },
136
+ subscribeAccountEvents: jest.fn()
102
137
  }
103
138
  };
139
+ apexMock.getApex = jest.fn(function () {
140
+ return apexMock;
141
+ });
142
+ return apexMock;
104
143
  });
105
144
  jest.mock('../../services/subscriptions/verificationLevelUpdateService', function () {
106
145
  var updateData = [];
@@ -138,6 +177,12 @@ jest.mock('../../services/subscriptions/settlementSubscriptionService', function
138
177
  stop: jest.fn()
139
178
  };
140
179
  });
180
+ jest.mock('../../services/subscriptions/AccountEventsSubscriptionService', function () {
181
+ return {
182
+ subscribe: jest.fn(),
183
+ stop: jest.fn()
184
+ };
185
+ });
141
186
  jest.mock('./orderHistoryActions', function () {
142
187
  return {
143
188
  getOrders: jest.fn().mockImplementation(function () {
@@ -169,6 +214,11 @@ jest.mock('./orderHistoryActions', function () {
169
214
  return {
170
215
  type: 'mock'
171
216
  };
217
+ }),
218
+ subscribeToMarginCancelOrderLiquidationEvents: jest.fn().mockImplementation(function () {
219
+ return {
220
+ type: 'mock'
221
+ };
172
222
  })
173
223
  };
174
224
  });
@@ -222,6 +272,11 @@ jest.mock('./withdrawActions', function () {
222
272
  return {
223
273
  type: 'mock'
224
274
  };
275
+ }),
276
+ getAccountVerificationLevelConfig: jest.fn().mockImplementation(function () {
277
+ return {
278
+ type: 'mock'
279
+ };
225
280
  })
226
281
  };
227
282
  });
@@ -276,15 +331,6 @@ jest.mock('./snackbarActions', function () {
276
331
  })
277
332
  };
278
333
  });
279
- jest.mock('./languageActions', function () {
280
- return {
281
- changeLanguage: jest.fn().mockImplementation(function () {
282
- return {
283
- type: 'changeLanguage'
284
- };
285
- })
286
- };
287
- });
288
334
  jest.mock('./modalActions', function () {
289
335
  return {
290
336
  closeModal: jest.fn().mockImplementation(function (payload) {
@@ -326,7 +372,12 @@ jest.mock('redux-form', function () {
326
372
  }),
327
373
  actionTypes: {
328
374
  CHANGE: 'CHANGE'
329
- }
375
+ },
376
+ formValueSelector: jest.fn().mockImplementation(function (option) {
377
+ return function (Component) {
378
+ return Component;
379
+ };
380
+ })
330
381
  };
331
382
  });
332
383
  jest.mock('../../config', function () {
@@ -337,6 +388,12 @@ jest.mock('../../config', function () {
337
388
  },
338
389
  global: {
339
390
  privateMarketData: false
391
+ },
392
+ Middleware: {
393
+ level2MonitorInterval: 60000
394
+ },
395
+ Snackbar: {
396
+ timeout: 15000
340
397
  }
341
398
  };
342
399
  return _objectSpread({
@@ -352,6 +409,52 @@ jest.mock('../margin/selectors', function () {
352
409
  return {
353
410
  marginAccountSelector: jest.fn(function () {
354
411
  return {};
412
+ }),
413
+ defaultAccountSelector: jest.fn(function () {
414
+ return undefined;
415
+ }),
416
+ isMarginActiveSelector: jest.fn(function () {
417
+ return false;
418
+ }),
419
+ marginAccountEquitySelector: jest.fn(function () {
420
+ return 0;
421
+ })
422
+ };
423
+ });
424
+ jest.mock('../futures/actions', function () {
425
+ return {
426
+ initFuturesTrading: jest.fn(function () {
427
+ return {
428
+ type: 'mock'
429
+ };
430
+ }),
431
+ preloadFuturesData: jest.fn(function () {
432
+ return {
433
+ type: 'mock'
434
+ };
435
+ }),
436
+ subscribeFuturesOrderHistory: jest.fn(function () {
437
+ return {
438
+ type: 'mock'
439
+ };
440
+ })
441
+ };
442
+ });
443
+ jest.mock('../futures/actions/futuresInstrumentsActions', function () {
444
+ return {
445
+ getFuturesInstruments: jest.fn(function () {
446
+ return {
447
+ type: 'mock'
448
+ };
449
+ })
450
+ };
451
+ });
452
+ jest.mock('./instrumentActions', function () {
453
+ return {
454
+ selectInstrument: jest.fn(function () {
455
+ return {
456
+ type: 'mock'
457
+ };
355
458
  })
356
459
  };
357
460
  });
@@ -359,6 +462,7 @@ console.error = jest.fn();
359
462
  describe('userActions', function () {
360
463
  var store;
361
464
  beforeEach(function () {
465
+ _apex["default"].connection.resetRPCPromiseResponses();
362
466
  store = mockStore({
363
467
  auth: {
364
468
  userId: 1
@@ -366,7 +470,20 @@ describe('userActions', function () {
366
470
  user: {
367
471
  userInfo: {
368
472
  Use2FA: false
369
- }
473
+ },
474
+ accounts: [{
475
+ AccountId: 1,
476
+ AccountType: 'Standard'
477
+ }]
478
+ },
479
+ api: {
480
+ validate2FARequiredEndpoints: {}
481
+ },
482
+ apexCore: {
483
+ instrument: {}
484
+ },
485
+ futures: {
486
+ instruments: {}
370
487
  }
371
488
  });
372
489
  global.localStorage = {
@@ -412,49 +529,81 @@ describe('userActions', function () {
412
529
  describe('getUserInfo', function () {
413
530
  beforeEach(function () {
414
531
  jest.clearAllMocks();
532
+ _apex["default"].connection.resetRPCPromiseResponses();
415
533
  var userInfo = {
416
534
  UserId: 99,
417
535
  OMSId: 99,
418
- AccountId: 99
536
+ AccountId: 99,
537
+ OperatorId: 1
419
538
  };
420
- _apex["default"].connection.setResponse(userInfo);
421
- _apex["default"].connection.setGetUserInfoResponse(Promise.resolve(userInfo));
539
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserInfo', {
540
+ o: JSON.stringify(userInfo)
541
+ });
542
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetOMSs', {
543
+ o: JSON.stringify([])
544
+ });
545
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserPermissions', {
546
+ o: JSON.stringify([])
547
+ });
548
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserConfig', {
549
+ o: JSON.stringify([])
550
+ });
551
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserAccounts', {
552
+ o: JSON.stringify([])
553
+ });
554
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserAffiliateTag', {
555
+ o: JSON.stringify({})
556
+ });
557
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetOperatorLoyaltyFeeConfigsForOms', {
558
+ o: JSON.stringify([])
559
+ });
422
560
  });
423
- it('should call console.warn', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
561
+ var getState = jest.fn(function () {
562
+ return {
563
+ user: {
564
+ accounts: []
565
+ }
566
+ };
567
+ });
568
+ it('should log an error when GetUserInfo fails', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
424
569
  return _regenerator().w(function (_context) {
425
570
  while (1) switch (_context.n) {
426
571
  case 0:
427
- _apex["default"].connection.setGetUserInfoResponse(Promise.reject());
572
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserInfo', Promise.reject(new Error('fail')));
428
573
  _context.n = 1;
429
- return actions.getUserInfo(99)(dispatchStub);
574
+ return expect(actions.getUserInfo(99)(dispatchStub, getState)).rejects.toThrow();
430
575
  case 1:
431
- expect(console.error).toHaveBeenCalled();
576
+ expect(console.error).toHaveBeenCalledWith('getUserInfo action error', expect.anything());
432
577
  case 2:
433
578
  return _context.a(2);
434
579
  }
435
580
  }, _callee);
436
581
  })));
437
- it('getUserInfo should call apex.connection.getUserInfo', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
582
+ it('getUserInfo should call apex.connection.RPCPromise with GetUserInfo', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
438
583
  return _regenerator().w(function (_context2) {
439
584
  while (1) switch (_context2.n) {
440
585
  case 0:
441
586
  _context2.n = 1;
442
- return actions.getUserInfo(99)(dispatchStub);
587
+ return actions.getUserInfo(99)(dispatchStub, getState);
443
588
  case 1:
444
- expect(_apex["default"].connection.GetUserInfo).toHaveBeenCalled();
589
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('GetUserInfo', {
590
+ UserId: 99
591
+ });
445
592
  case 2:
446
593
  return _context2.a(2);
447
594
  }
448
595
  }, _callee2);
449
596
  })));
450
- it('getUserPermissions should call apex.connection.getUserPermissions', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
597
+ it('getUserPermissions should call apex.connection.RPCPromise with GetUserPermissions', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
451
598
  return _regenerator().w(function (_context3) {
452
599
  while (1) switch (_context3.n) {
453
600
  case 0:
454
601
  _context3.n = 1;
455
602
  return actions.getUserPermissions(99)(dispatchStub);
456
603
  case 1:
457
- expect(_apex["default"].connection.GetUserPermissions).toHaveBeenCalled();
604
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('GetUserPermissions', {
605
+ UserId: 99
606
+ });
458
607
  case 2:
459
608
  return _context3.a(2);
460
609
  }
@@ -464,30 +613,36 @@ describe('userActions', function () {
464
613
  describe('getUserConfig', function () {
465
614
  beforeEach(function () {
466
615
  jest.clearAllMocks();
467
- _apex["default"].connection.setGetAccountInfoResponse(Promise.resolve());
616
+ _apex["default"].connection.resetRPCPromiseResponses();
468
617
  });
469
618
  it('should call console error if response is rejected', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
470
619
  return _regenerator().w(function (_context4) {
471
620
  while (1) switch (_context4.n) {
472
621
  case 0:
473
- _apex["default"].connection.setGetAccountInfoResponse(Promise.reject());
622
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserConfig', Promise.reject(new Error('fail')));
474
623
  _context4.n = 1;
475
624
  return actions.getUserConfig(99)(dispatchStub);
476
625
  case 1:
477
- expect(console.error).toHaveBeenCalled();
626
+ expect(console.error).toHaveBeenCalledWith('getUserConfig action error', expect.anything());
478
627
  case 2:
479
628
  return _context4.a(2);
480
629
  }
481
630
  }, _callee4);
482
631
  })));
483
- it('getUserConfig should call apex.connection.getUserConfig', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
632
+ it('getUserConfig should call apex.connection.RPCPromise with GetUserConfig', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
484
633
  return _regenerator().w(function (_context5) {
485
634
  while (1) switch (_context5.n) {
486
635
  case 0:
636
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserConfig', {
637
+ o: JSON.stringify([])
638
+ });
487
639
  _context5.n = 1;
488
640
  return actions.getUserConfig(99)(dispatchStub);
489
641
  case 1:
490
- expect(_apex["default"].connection.GetUserConfig).toHaveBeenCalled();
642
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('GetUserConfig', {
643
+ UserId: 99,
644
+ UserName: undefined
645
+ });
491
646
  case 2:
492
647
  return _context5.a(2);
493
648
  }
@@ -497,7 +652,10 @@ describe('userActions', function () {
497
652
  describe('getUserAccounts', function () {
498
653
  beforeEach(function () {
499
654
  jest.clearAllMocks();
500
- _apex["default"].connection.setGetAccountInfoResponse({});
655
+ _apex["default"].connection.resetRPCPromiseResponses();
656
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetAccountInfo', {
657
+ o: JSON.stringify({})
658
+ });
501
659
  });
502
660
  it('should call apex.connection.getUserAccounts', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
503
661
  var userAccountIds, accountInfo;
@@ -508,28 +666,41 @@ describe('userActions', function () {
508
666
  accountInfo = {
509
667
  foo: 'foo'
510
668
  };
511
- _apex["default"].connection.setGetUserAccountsResponse(userAccountIds);
512
- _apex["default"].connection.setGetAccountInfoResponse(accountInfo);
669
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserAccounts', {
670
+ o: JSON.stringify(userAccountIds)
671
+ });
672
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetAccountInfo', {
673
+ o: JSON.stringify(accountInfo)
674
+ });
513
675
  _context6.n = 1;
514
676
  return actions.getUserAccounts(99)(dispatchStub);
515
677
  case 1:
516
- expect(_apex["default"].connection.GetUserAccounts).toHaveBeenCalled();
678
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('GetUserAccounts', {
679
+ OMSId: 99
680
+ });
517
681
  case 2:
518
682
  return _context6.a(2);
519
683
  }
520
684
  }, _callee6);
521
685
  })));
522
686
  it('should call getAccountInfo after getUserAccounts for each UserAccount', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
523
- var userAccountIds;
687
+ var userAccountIds, getAccountInfoCalls;
524
688
  return _regenerator().w(function (_context7) {
525
689
  while (1) switch (_context7.n) {
526
690
  case 0:
527
691
  userAccountIds = [1, 2, 3];
528
- _apex["default"].connection.setGetUserAccountsResponse(userAccountIds);
692
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserAccounts', {
693
+ o: JSON.stringify(userAccountIds)
694
+ });
529
695
  _context7.n = 1;
530
696
  return actions.getUserAccounts(99)(dispatchStub);
531
697
  case 1:
532
- expect(_apex["default"].connection.GetAccountInfo.mock.calls.length).toBe(3);
698
+ getAccountInfoCalls = _apex["default"].connection.RPCPromise.mock.calls.filter(function (_ref8) {
699
+ var _ref9 = _slicedToArray(_ref8, 1),
700
+ endpoint = _ref9[0];
701
+ return endpoint === 'GetAccountInfo';
702
+ });
703
+ expect(getAccountInfoCalls.length).toBe(3);
533
704
  case 2:
534
705
  return _context7.a(2);
535
706
  }
@@ -560,8 +731,12 @@ describe('userActions', function () {
560
731
  type: actions.RECEIVE_ACCOUNT,
561
732
  payload: [accountInfo]
562
733
  }];
563
- _apex["default"].connection.setGetUserAccountsResponse(userAccountIds);
564
- _apex["default"].connection.setGetAccountInfoResponse(accountInfo);
734
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserAccounts', {
735
+ o: JSON.stringify(userAccountIds)
736
+ });
737
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetAccountInfo', {
738
+ o: JSON.stringify(accountInfo)
739
+ });
565
740
  _context8.n = 1;
566
741
  return store.dispatch(actions.getUserAccounts());
567
742
  case 1:
@@ -596,8 +771,12 @@ describe('userActions', function () {
596
771
  type: actions.RECEIVE_ACCOUNT,
597
772
  payload: [accountInfo]
598
773
  }];
599
- _apex["default"].connection.setGetUserAccountsResponse(userAccountIds);
600
- _apex["default"].connection.setGetAccountInfoResponse(accountInfo);
774
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserAccounts', {
775
+ o: JSON.stringify(userAccountIds)
776
+ });
777
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetAccountInfo', {
778
+ o: JSON.stringify(accountInfo)
779
+ });
601
780
  _context9.n = 1;
602
781
  return store.dispatch(actions.getUserAccounts());
603
782
  case 1:
@@ -624,16 +803,13 @@ describe('userActions', function () {
624
803
  payload: accountId
625
804
  }];
626
805
  expect(store.getActions()).toEqual(expect.arrayContaining(expectedActions));
627
- expect(orderHistoryActions.getOpenOrders).toHaveBeenCalled();
628
- expect(orderHistoryActions.getAccountTrades).toHaveBeenCalled();
629
- expect(orderHistoryActions.getOpenTradeReports).toHaveBeenCalled();
630
- expect(depositActions.getDepositTickets).toHaveBeenCalled();
631
- expect(withdrawActions.getWithdrawTickets).toHaveBeenCalled();
806
+ expect(orderHistoryActions.getOrders).not.toHaveBeenCalled();
632
807
  expect(orderHistoryActions.subscribeToOrderHistory).toHaveBeenCalled();
808
+ expect(orderHistoryActions.subscribeToMarginCancelOrderLiquidationEvents).toHaveBeenCalled();
809
+ expect(withdrawActions.subscribeToWithdrawalTickets).toHaveBeenCalled();
633
810
  expect(transferActions.getTransfers).toHaveBeenCalled();
634
811
  expect(positionActions.getAccountPositions).toHaveBeenCalled();
635
812
  expect(positionActions.subscribeToAccountPositionEvents).toHaveBeenCalled();
636
- expect(positionActions.selectPosition).toHaveBeenCalled();
637
813
  case 2:
638
814
  return _context0.a(2);
639
815
  }
@@ -654,63 +830,24 @@ describe('userActions', function () {
654
830
  payload: accountId
655
831
  }];
656
832
  expect(store.getActions()).toEqual(expect.arrayContaining(expectedActions));
657
- expect(orderHistoryActions.getOpenOrders).toHaveBeenCalled();
658
833
  expect(orderHistoryActions.getOrders).toHaveBeenCalled();
659
- expect(orderHistoryActions.getAccountTrades).toHaveBeenCalled();
660
- expect(orderHistoryActions.getOpenTradeReports).toHaveBeenCalled();
661
- expect(depositActions.getDepositTickets).toHaveBeenCalled();
662
- expect(withdrawActions.getWithdrawTickets).toHaveBeenCalled();
663
834
  expect(orderHistoryActions.subscribeToOrderHistory).toHaveBeenCalled();
835
+ expect(orderHistoryActions.subscribeToMarginCancelOrderLiquidationEvents).toHaveBeenCalled();
836
+ expect(withdrawActions.subscribeToWithdrawalTickets).toHaveBeenCalled();
664
837
  expect(transferActions.getTransfers).toHaveBeenCalled();
665
838
  expect(positionActions.getAccountPositions).toHaveBeenCalled();
666
839
  expect(positionActions.subscribeToAccountPositionEvents).toHaveBeenCalled();
667
- expect(positionActions.selectPosition).toHaveBeenCalled();
668
840
  case 2:
669
841
  return _context1.a(2);
670
842
  }
671
843
  }, _callee1);
672
844
  })));
673
- it('should dispatch selectPosition with selectedPositionId from localStorage, if such Id is in the positions array ', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
674
- var selectedPositionId;
675
- return _regenerator().w(function (_context10) {
676
- while (1) switch (_context10.n) {
677
- case 0:
678
- selectedPositionId = 2;
679
- global.localStorage.getItem = function (item) {
680
- return item === 'selectedPositionId' ? selectedPositionId : 0;
681
- };
682
- _context10.n = 1;
683
- return store.dispatch(actions.selectAccount(1, 1));
684
- case 1:
685
- expect(positionActions.selectPosition).toHaveBeenCalledWith(2);
686
- case 2:
687
- return _context10.a(2);
688
- }
689
- }, _callee10);
690
- })));
691
- it('should dispatch selectPosition with first positionId from positions array, if such Id is not in the positions array ', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
692
- var selectedPositionId;
693
- return _regenerator().w(function (_context11) {
694
- while (1) switch (_context11.n) {
695
- case 0:
696
- selectedPositionId = 100;
697
- global.localStorage.getItem = function (item) {
698
- return item === 'selectedPositionId' ? selectedPositionId : 0;
699
- };
700
- _context11.n = 1;
701
- return store.dispatch(actions.selectAccount(1, 1));
702
- case 1:
703
- expect(positionActions.selectPosition).toHaveBeenCalledWith(1);
704
- case 2:
705
- return _context11.a(2);
706
- }
707
- }, _callee11);
708
- })));
709
845
  });
710
846
  describe('updateAccount', function () {
711
847
  var store;
712
848
  beforeEach(function () {
713
849
  jest.clearAllMocks();
850
+ _apex["default"].connection.resetRPCPromiseResponses();
714
851
  store = mockStore({
715
852
  user: {
716
853
  userInfo: {
@@ -720,90 +857,124 @@ describe('userActions', function () {
720
857
  accounts: [{
721
858
  AccountId: 1
722
859
  }]
860
+ },
861
+ api: {
862
+ validate2FARequiredEndpoints: {}
723
863
  }
724
864
  });
725
865
  });
726
- it('should call UpdateAccount from apex', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
727
- return _regenerator().w(function (_context12) {
728
- while (1) switch (_context12.n) {
866
+ it('should call UpdateAccount from apex', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
867
+ return _regenerator().w(function (_context10) {
868
+ while (1) switch (_context10.n) {
729
869
  case 0:
730
- _context12.n = 1;
870
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('UpdateAccount', {
871
+ o: JSON.stringify({
872
+ result: false
873
+ })
874
+ });
875
+ _context10.n = 1;
731
876
  return store.dispatch(actions.updateAccount());
732
877
  case 1:
733
- expect(_apex["default"].connection.UpdateAccount).toHaveBeenCalled();
878
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('UpdateAccount', {
879
+ AccountId: 1,
880
+ LoyaltyEnabled: false,
881
+ LoyaltyProductId: 0
882
+ });
734
883
  case 2:
735
- return _context12.a(2);
884
+ return _context10.a(2);
736
885
  }
737
- }, _callee12);
886
+ }, _callee10);
738
887
  })));
739
- it('should call UpdateAccount from apex with params if loyaltyProduct is passed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
888
+ it('should call UpdateAccount from apex with params if loyaltyProduct is passed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
740
889
  var loyaltyProduct;
741
- return _regenerator().w(function (_context13) {
742
- while (1) switch (_context13.n) {
890
+ return _regenerator().w(function (_context11) {
891
+ while (1) switch (_context11.n) {
743
892
  case 0:
893
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('UpdateAccount', {
894
+ o: JSON.stringify({
895
+ result: false
896
+ })
897
+ });
744
898
  loyaltyProduct = {
745
899
  ProductId: 2,
746
900
  Amount: 1
747
901
  };
748
- _context13.n = 1;
902
+ _context11.n = 1;
749
903
  return store.dispatch(actions.updateAccount(loyaltyProduct));
750
904
  case 1:
751
- expect(_apex["default"].connection.UpdateAccount).toHaveBeenCalledWith({
905
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('UpdateAccount', {
752
906
  AccountId: 1,
753
907
  LoyaltyEnabled: true,
754
908
  LoyaltyProductId: 2
755
909
  });
756
910
  case 2:
757
- return _context13.a(2);
911
+ return _context11.a(2);
758
912
  }
759
- }, _callee13);
913
+ }, _callee11);
760
914
  })));
761
- it('should call UpdateAccount from apex with params if loyaltyProduct is passed and Amount === 0', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
915
+ it('should call UpdateAccount from apex with params if loyaltyProduct is passed and Amount === 0', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
762
916
  var loyaltyProduct;
763
- return _regenerator().w(function (_context14) {
764
- while (1) switch (_context14.n) {
917
+ return _regenerator().w(function (_context12) {
918
+ while (1) switch (_context12.n) {
765
919
  case 0:
920
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('UpdateAccount', {
921
+ o: JSON.stringify({
922
+ result: false
923
+ })
924
+ });
766
925
  loyaltyProduct = {
767
926
  ProductId: 2,
768
927
  Amount: 0
769
928
  };
770
- _context14.n = 1;
929
+ _context12.n = 1;
771
930
  return store.dispatch(actions.updateAccount(loyaltyProduct));
772
931
  case 1:
773
- expect(_apex["default"].connection.UpdateAccount).toHaveBeenCalledWith({
932
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('UpdateAccount', {
774
933
  AccountId: 1,
775
934
  LoyaltyEnabled: false,
776
935
  LoyaltyProductId: 2
777
936
  });
778
937
  case 2:
779
- return _context14.a(2);
938
+ return _context12.a(2);
780
939
  }
781
- }, _callee14);
940
+ }, _callee12);
782
941
  })));
783
- it('should dispatch expected action if response result is true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
784
- return _regenerator().w(function (_context15) {
785
- while (1) switch (_context15.n) {
942
+ it('should dispatch expected action if response result is true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
943
+ return _regenerator().w(function (_context13) {
944
+ while (1) switch (_context13.n) {
786
945
  case 0:
787
- _apex["default"].connection.setResponse({
788
- result: true
946
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('UpdateAccount', {
947
+ o: JSON.stringify({
948
+ result: true
949
+ })
789
950
  });
790
- _context15.n = 1;
951
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserAccounts', {
952
+ o: JSON.stringify([])
953
+ });
954
+ _context13.n = 1;
791
955
  return store.dispatch(actions.updateAccount());
792
956
  case 1:
793
- expect(_apex["default"].connection.GetUserAccounts).toHaveBeenCalled();
957
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('GetUserAccounts', {
958
+ OMSId: 1
959
+ });
794
960
  case 2:
795
- return _context15.a(2);
961
+ return _context13.a(2);
796
962
  }
797
- }, _callee15);
963
+ }, _callee13);
798
964
  })));
799
- it('should dispatch showSnack if response result is true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16() {
800
- return _regenerator().w(function (_context16) {
801
- while (1) switch (_context16.n) {
965
+ it('should dispatch showSnack if response result is true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
966
+ return _regenerator().w(function (_context14) {
967
+ while (1) switch (_context14.n) {
802
968
  case 0:
803
- _apex["default"].connection.setResponse({
804
- result: true
969
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('UpdateAccount', {
970
+ o: JSON.stringify({
971
+ result: true
972
+ })
805
973
  });
806
- _context16.n = 1;
974
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserAccounts', {
975
+ o: JSON.stringify([])
976
+ });
977
+ _context14.n = 1;
807
978
  return store.dispatch(actions.updateAccount());
808
979
  case 1:
809
980
  expect(snackbarActions.showSnack).toHaveBeenCalledWith({
@@ -812,23 +983,28 @@ describe('userActions', function () {
812
983
  type: 'success'
813
984
  });
814
985
  case 2:
815
- return _context16.a(2);
986
+ return _context14.a(2);
816
987
  }
817
- }, _callee16);
988
+ }, _callee14);
818
989
  })));
819
- it('should dispatch showSnack if response result is true and loyaltyProduct is passed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
990
+ it('should dispatch showSnack if response result is true and loyaltyProduct is passed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15() {
820
991
  var loyaltyProduct;
821
- return _regenerator().w(function (_context17) {
822
- while (1) switch (_context17.n) {
992
+ return _regenerator().w(function (_context15) {
993
+ while (1) switch (_context15.n) {
823
994
  case 0:
824
- _apex["default"].connection.setResponse({
825
- result: true
995
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('UpdateAccount', {
996
+ o: JSON.stringify({
997
+ result: true
998
+ })
999
+ });
1000
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserAccounts', {
1001
+ o: JSON.stringify([])
826
1002
  });
827
1003
  loyaltyProduct = {
828
1004
  ProductId: 2,
829
1005
  Amount: 0
830
1006
  };
831
- _context17.n = 1;
1007
+ _context15.n = 1;
832
1008
  return store.dispatch(actions.updateAccount(loyaltyProduct));
833
1009
  case 1:
834
1010
  expect(snackbarActions.showSnack).toHaveBeenCalledWith({
@@ -837,52 +1013,61 @@ describe('userActions', function () {
837
1013
  type: 'success'
838
1014
  });
839
1015
  case 2:
840
- return _context17.a(2);
1016
+ return _context15.a(2);
841
1017
  }
842
- }, _callee17);
1018
+ }, _callee15);
843
1019
  })));
844
- it('should dispatch showSnack if response result is false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18() {
845
- return _regenerator().w(function (_context18) {
846
- while (1) switch (_context18.n) {
1020
+ it('should dispatch showSnack if response result is false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16() {
1021
+ return _regenerator().w(function (_context16) {
1022
+ while (1) switch (_context16.n) {
847
1023
  case 0:
848
- _apex["default"].connection.setResponse({
849
- result: false
1024
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('UpdateAccount', {
1025
+ o: JSON.stringify({
1026
+ result: false
1027
+ })
850
1028
  });
851
- _context18.n = 1;
1029
+ _context16.n = 1;
852
1030
  return store.dispatch(actions.updateAccount());
853
1031
  case 1:
854
1032
  expect(snackbarActions.showSnack).toHaveBeenCalled();
855
1033
  case 2:
856
- return _context18.a(2);
1034
+ return _context16.a(2);
857
1035
  }
858
- }, _callee18);
1036
+ }, _callee16);
859
1037
  })));
860
1038
  });
861
1039
  describe('setUserInfo', function () {
862
- it('should call apex.connection.SetUserInfo', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19() {
863
- var userInfo, user;
864
- return _regenerator().w(function (_context19) {
865
- while (1) switch (_context19.n) {
1040
+ beforeEach(function () {
1041
+ _apex["default"].connection.resetRPCPromiseResponses();
1042
+ });
1043
+ it('should call apex.connection.RPCPromise with SetUserInfo', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
1044
+ var user;
1045
+ return _regenerator().w(function (_context17) {
1046
+ while (1) switch (_context17.n) {
866
1047
  case 0:
867
- userInfo = {};
868
1048
  user = {
869
1049
  UserName: 'UserName',
870
1050
  Email: 'example@gmail.com'
871
1051
  };
872
- _apex["default"].connection.setResponse(userInfo);
873
- _context19.n = 1;
1052
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('SetUserInfo', {
1053
+ o: JSON.stringify({})
1054
+ });
1055
+ _context17.n = 1;
874
1056
  return actions.setUserInfo(user)(dispatchStub);
875
1057
  case 1:
876
- expect(_apex["default"].connection.SetUserInfo).toHaveBeenCalled();
1058
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('SetUserInfo', {
1059
+ UserName: undefined,
1060
+ Email: undefined
1061
+ });
877
1062
  case 2:
878
- return _context19.a(2);
1063
+ return _context17.a(2);
879
1064
  }
880
- }, _callee19);
1065
+ }, _callee17);
881
1066
  })));
882
- it('should dispatch expected actions after set user info', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20() {
1067
+ it('should dispatch expected actions after set user info', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18() {
883
1068
  var userInfo, user, expectedActions;
884
- return _regenerator().w(function (_context20) {
885
- while (1) switch (_context20.n) {
1069
+ return _regenerator().w(function (_context18) {
1070
+ while (1) switch (_context18.n) {
886
1071
  case 0:
887
1072
  userInfo = {
888
1073
  result: true
@@ -894,23 +1079,23 @@ describe('userActions', function () {
894
1079
  expectedActions = [{
895
1080
  type: actions.USER_INFO_FETCHED,
896
1081
  payload: userInfo
897
- }, {
898
- type: 'changeLanguage'
899
1082
  }];
900
- _apex["default"].connection.setResponse(userInfo);
901
- _context20.n = 1;
1083
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('SetUserInfo', {
1084
+ o: JSON.stringify(userInfo)
1085
+ });
1086
+ _context18.n = 1;
902
1087
  return store.dispatch(actions.setUserInfo(user));
903
1088
  case 1:
904
1089
  expect(store.getActions()).toEqual(expect.arrayContaining(expectedActions));
905
1090
  case 2:
906
- return _context20.a(2);
1091
+ return _context18.a(2);
907
1092
  }
908
- }, _callee20);
1093
+ }, _callee18);
909
1094
  })));
910
- it('should dispatch expected actions after failed set user info', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21() {
1095
+ it('should dispatch expected actions after failed set user info', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19() {
911
1096
  var userInfo, user;
912
- return _regenerator().w(function (_context21) {
913
- while (1) switch (_context21.n) {
1097
+ return _regenerator().w(function (_context19) {
1098
+ while (1) switch (_context19.n) {
914
1099
  case 0:
915
1100
  userInfo = {
916
1101
  result: false
@@ -919,48 +1104,64 @@ describe('userActions', function () {
919
1104
  UserName: 'UserName',
920
1105
  Email: 'example@gmail.com'
921
1106
  };
922
- _apex["default"].connection.setResponse(userInfo);
923
- _context21.n = 1;
1107
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('SetUserInfo', {
1108
+ o: JSON.stringify(userInfo)
1109
+ });
1110
+ _context19.n = 1;
924
1111
  return store.dispatch(actions.setUserInfo(user));
925
1112
  case 1:
926
1113
  expect(snackbarActions.showSnack).toHaveBeenCalled();
927
1114
  case 2:
928
- return _context21.a(2);
1115
+ return _context19.a(2);
929
1116
  }
930
- }, _callee21);
1117
+ }, _callee19);
931
1118
  })));
932
1119
  });
933
1120
  describe('setUserConfig', function () {
934
1121
  beforeEach(function () {
935
1122
  jest.clearAllMocks();
936
- _apex["default"].connection.setGetAccountInfoResponse({
937
- foo: 'foo'
1123
+ _apex["default"].connection.resetRPCPromiseResponses();
1124
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('GetUserConfig', {
1125
+ o: JSON.stringify({
1126
+ foo: 'foo'
1127
+ })
938
1128
  });
939
1129
  });
940
- it('should call apex.connection.SetUserConfig', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22() {
941
- return _regenerator().w(function (_context22) {
942
- while (1) switch (_context22.n) {
1130
+ it('should call apex.connection.RPCPromise with SetUserConfig', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20() {
1131
+ return _regenerator().w(function (_context20) {
1132
+ while (1) switch (_context20.n) {
943
1133
  case 0:
944
- _context22.n = 1;
1134
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('SetUserConfig', {
1135
+ o: JSON.stringify({
1136
+ result: false
1137
+ })
1138
+ });
1139
+ _context20.n = 1;
945
1140
  return store.dispatch(actions.setUserConfig());
946
1141
  case 1:
947
- expect(_apex["default"].connection.SetUserConfig).toHaveBeenCalled();
1142
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('SetUserConfig', {
1143
+ UserId: undefined,
1144
+ UserName: undefined,
1145
+ Config: undefined
1146
+ });
948
1147
  case 2:
949
- return _context22.a(2);
1148
+ return _context20.a(2);
950
1149
  }
951
- }, _callee22);
1150
+ }, _callee20);
952
1151
  })));
953
- it('should dispatch expected actions after set user config', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
954
- return _regenerator().w(function (_context23) {
955
- while (1) switch (_context23.n) {
1152
+ it('should dispatch expected actions after set user config', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21() {
1153
+ return _regenerator().w(function (_context21) {
1154
+ while (1) switch (_context21.n) {
956
1155
  case 0:
957
- _apex["default"].connection.setResponse({
958
- result: true
1156
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('SetUserConfig', {
1157
+ o: JSON.stringify({
1158
+ result: true
1159
+ })
959
1160
  });
960
- _context23.n = 1;
1161
+ _context21.n = 1;
961
1162
  return store.dispatch(actions.setUserConfig());
962
1163
  case 1:
963
- return _context23.a(2, new Promise(function (resolve, reject) {
1164
+ return _context21.a(2, new Promise(function (resolve, reject) {
964
1165
  setTimeout(function () {
965
1166
  try {
966
1167
  expect(store.getActions()).toEqual([{
@@ -976,31 +1177,36 @@ describe('userActions', function () {
976
1177
  }, 0);
977
1178
  }));
978
1179
  }
979
- }, _callee23);
1180
+ }, _callee21);
980
1181
  })));
981
- it('should dispatch expected actions after failed set user config', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
982
- return _regenerator().w(function (_context24) {
983
- while (1) switch (_context24.n) {
1182
+ it('should dispatch expected actions after failed set user config', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22() {
1183
+ return _regenerator().w(function (_context22) {
1184
+ while (1) switch (_context22.n) {
984
1185
  case 0:
985
- _apex["default"].connection.setResponse({
986
- result: false
1186
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('SetUserConfig', {
1187
+ o: JSON.stringify({
1188
+ result: false
1189
+ })
987
1190
  });
988
- _context24.n = 1;
1191
+ _context22.n = 1;
989
1192
  return store.dispatch(actions.setUserConfig());
990
1193
  case 1:
991
1194
  expect(snackbarActions.showSnack).toHaveBeenCalled();
992
1195
  case 2:
993
- return _context24.a(2);
1196
+ return _context22.a(2);
994
1197
  }
995
- }, _callee24);
1198
+ }, _callee22);
996
1199
  })));
997
1200
  });
998
1201
  describe('enable2FA', function () {
999
- it('should call apex.connection.Authenticate2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25() {
1202
+ it('should call apex.connection.Authenticate2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
1000
1203
  var getState;
1001
- return _regenerator().w(function (_context25) {
1002
- while (1) switch (_context25.n) {
1204
+ return _regenerator().w(function (_context23) {
1205
+ while (1) switch (_context23.n) {
1003
1206
  case 0:
1207
+ _apex["default"].connection.setResponse({
1208
+ Authenticated: true
1209
+ });
1004
1210
  getState = jest.fn(function () {
1005
1211
  return {
1006
1212
  user: {
@@ -1010,23 +1216,23 @@ describe('userActions', function () {
1010
1216
  }
1011
1217
  };
1012
1218
  });
1013
- _context25.n = 1;
1219
+ _context23.n = 1;
1014
1220
  return actions.enable2FA()(dispatchStub, getState);
1015
1221
  case 1:
1016
1222
  expect(_apex["default"].connection.Authenticate2FA).toHaveBeenCalled();
1017
1223
  case 2:
1018
- return _context25.a(2);
1224
+ return _context23.a(2);
1019
1225
  }
1020
- }, _callee25);
1226
+ }, _callee23);
1021
1227
  })));
1022
- it('should dispatch expected actions after enable2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26() {
1023
- return _regenerator().w(function (_context26) {
1024
- while (1) switch (_context26.n) {
1228
+ it('should dispatch expected actions after enable2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
1229
+ return _regenerator().w(function (_context24) {
1230
+ while (1) switch (_context24.n) {
1025
1231
  case 0:
1026
1232
  _apex["default"].connection.setResponse({
1027
1233
  Authenticated: true
1028
1234
  });
1029
- _context26.n = 1;
1235
+ _context24.n = 1;
1030
1236
  return store.dispatch(actions.enable2FA());
1031
1237
  case 1:
1032
1238
  expect(store.getActions()).toContainEqual({
@@ -1041,32 +1247,32 @@ describe('userActions', function () {
1041
1247
  });
1042
1248
  expect(snackbarActions.showSnack).toHaveBeenCalled();
1043
1249
  case 2:
1044
- return _context26.a(2);
1250
+ return _context24.a(2);
1045
1251
  }
1046
- }, _callee26);
1252
+ }, _callee24);
1047
1253
  })));
1048
- it('should dispatch expected actions after failed enable2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27() {
1049
- return _regenerator().w(function (_context27) {
1050
- while (1) switch (_context27.n) {
1254
+ it('should dispatch expected actions after failed enable2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25() {
1255
+ return _regenerator().w(function (_context25) {
1256
+ while (1) switch (_context25.n) {
1051
1257
  case 0:
1052
1258
  _apex["default"].connection.setResponse({
1053
1259
  Authenticated: false
1054
1260
  });
1055
- _context27.n = 1;
1261
+ _context25.n = 1;
1056
1262
  return store.dispatch(actions.enable2FA());
1057
1263
  case 1:
1058
1264
  expect(snackbarActions.showSnack).toHaveBeenCalled();
1059
1265
  case 2:
1060
- return _context27.a(2);
1266
+ return _context25.a(2);
1061
1267
  }
1062
- }, _callee27);
1268
+ }, _callee25);
1063
1269
  })));
1064
1270
  });
1065
1271
  describe('disable2FA', function () {
1066
- it('should call apex.connection.Disable2FA andapex.connection.Authenticate2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28() {
1272
+ it('should call apex.connection.Disable2FA andapex.connection.Authenticate2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26() {
1067
1273
  var getState;
1068
- return _regenerator().w(function (_context28) {
1069
- while (1) switch (_context28.n) {
1274
+ return _regenerator().w(function (_context26) {
1275
+ while (1) switch (_context26.n) {
1070
1276
  case 0:
1071
1277
  getState = jest.fn(function () {
1072
1278
  return {
@@ -1078,24 +1284,33 @@ describe('userActions', function () {
1078
1284
  }
1079
1285
  };
1080
1286
  });
1081
- _context28.n = 1;
1287
+ _apex["default"].connection.setRPCPromiseReturnValue(Promise.resolve({
1288
+ o: JSON.stringify({
1289
+ Authenticated: true
1290
+ })
1291
+ }));
1292
+ _context26.n = 1;
1082
1293
  return actions.disable2FA()(dispatchStub, getState);
1083
1294
  case 1:
1084
1295
  expect(_apex["default"].connection.Disable2FA).toHaveBeenCalled();
1085
- expect(_apex["default"].connection.Authenticate2FA).toHaveBeenCalled();
1296
+ expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('Authenticate2FA', {
1297
+ Code: undefined
1298
+ });
1086
1299
  case 2:
1087
- return _context28.a(2);
1300
+ return _context26.a(2);
1088
1301
  }
1089
- }, _callee28);
1302
+ }, _callee26);
1090
1303
  })));
1091
- it('should dispatch expected actions after disable2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29() {
1092
- return _regenerator().w(function (_context29) {
1093
- while (1) switch (_context29.n) {
1304
+ it('should dispatch expected actions after disable2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27() {
1305
+ return _regenerator().w(function (_context27) {
1306
+ while (1) switch (_context27.n) {
1094
1307
  case 0:
1095
- _apex["default"].connection.setResponse({
1096
- Authenticated: true
1097
- });
1098
- _context29.n = 1;
1308
+ _apex["default"].connection.setRPCPromiseReturnValue(Promise.resolve({
1309
+ o: JSON.stringify({
1310
+ Authenticated: true
1311
+ })
1312
+ }));
1313
+ _context27.n = 1;
1099
1314
  return store.dispatch(actions.disable2FA());
1100
1315
  case 1:
1101
1316
  expect(store.getActions()).toContainEqual({
@@ -1107,49 +1322,51 @@ describe('userActions', function () {
1107
1322
  expect(_modalActions.closeModal).toHaveBeenCalledWith(_modalActions.MODAL_TYPES.DISABLE_2FA);
1108
1323
  expect(snackbarActions.showSnack).toHaveBeenCalled();
1109
1324
  case 2:
1110
- return _context29.a(2);
1325
+ return _context27.a(2);
1111
1326
  }
1112
- }, _callee29);
1327
+ }, _callee27);
1113
1328
  })));
1114
- it('should dispatch expected actions after failed disable2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee30() {
1115
- return _regenerator().w(function (_context30) {
1116
- while (1) switch (_context30.n) {
1329
+ it('should dispatch expected actions after failed disable2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28() {
1330
+ return _regenerator().w(function (_context28) {
1331
+ while (1) switch (_context28.n) {
1117
1332
  case 0:
1118
- _apex["default"].connection.setResponse({
1119
- Authenticated: false
1120
- });
1121
- _context30.n = 1;
1333
+ _apex["default"].connection.setRPCPromiseReturnValue(Promise.resolve({
1334
+ o: JSON.stringify({
1335
+ Authenticated: false
1336
+ })
1337
+ }));
1338
+ _context28.n = 1;
1122
1339
  return store.dispatch(actions.disable2FA());
1123
1340
  case 1:
1124
1341
  expect(snackbarActions.showSnack).toHaveBeenCalled();
1125
1342
  case 2:
1126
- return _context30.a(2);
1343
+ return _context28.a(2);
1127
1344
  }
1128
- }, _callee30);
1345
+ }, _callee28);
1129
1346
  })));
1130
1347
  });
1131
1348
  describe('getGoogleQrCode', function () {
1132
- it('should call apex.connection.EnableGoogle2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31() {
1133
- return _regenerator().w(function (_context31) {
1134
- while (1) switch (_context31.n) {
1349
+ it('should call apex.connection.EnableGoogle2FA', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29() {
1350
+ return _regenerator().w(function (_context29) {
1351
+ while (1) switch (_context29.n) {
1135
1352
  case 0:
1136
- _context31.n = 1;
1353
+ _context29.n = 1;
1137
1354
  return actions.getGoogleQrCode()(dispatchStub);
1138
1355
  case 1:
1139
1356
  expect(_apex["default"].connection.EnableGoogle2FA).toHaveBeenCalled();
1140
1357
  case 2:
1141
- return _context31.a(2);
1358
+ return _context29.a(2);
1142
1359
  }
1143
- }, _callee31);
1360
+ }, _callee29);
1144
1361
  })));
1145
- it('should dispatch expected actions after getGoogleQrCode', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee32() {
1146
- return _regenerator().w(function (_context32) {
1147
- while (1) switch (_context32.n) {
1362
+ it('should dispatch expected actions after getGoogleQrCode', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee30() {
1363
+ return _regenerator().w(function (_context30) {
1364
+ while (1) switch (_context30.n) {
1148
1365
  case 0:
1149
1366
  _apex["default"].connection.setResponse({
1150
1367
  qrCode: 1234
1151
1368
  });
1152
- _context32.n = 1;
1369
+ _context30.n = 1;
1153
1370
  return store.dispatch(actions.getGoogleQrCode());
1154
1371
  case 1:
1155
1372
  expect(store.getActions()).toEqual([{
@@ -1159,16 +1376,16 @@ describe('userActions', function () {
1159
1376
  }
1160
1377
  }]);
1161
1378
  case 2:
1162
- return _context32.a(2);
1379
+ return _context30.a(2);
1163
1380
  }
1164
- }, _callee32);
1381
+ }, _callee30);
1165
1382
  })));
1166
1383
  });
1167
1384
  describe('getGoogle2FARecoveryCode', function () {
1168
- it('should return recovery code', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee33() {
1385
+ it('should return recovery code', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31() {
1169
1386
  var code;
1170
- return _regenerator().w(function (_context33) {
1171
- while (1) switch (_context33.n) {
1387
+ return _regenerator().w(function (_context31) {
1388
+ while (1) switch (_context31.n) {
1172
1389
  case 0:
1173
1390
  code = 123212;
1174
1391
  _apex["default"].connection.setRPCPromiseReturnValue(Promise.resolve({
@@ -1176,21 +1393,21 @@ describe('userActions', function () {
1176
1393
  Authenticated: true
1177
1394
  })
1178
1395
  }));
1179
- _context33.n = 1;
1396
+ _context31.n = 1;
1180
1397
  return actions.getGoogle2FARecoveryCode(code)(dispatchStub);
1181
1398
  case 1:
1182
1399
  expect(_apex["default"].connection.RPCPromise).toHaveBeenCalledWith('GetGoogle2FARecoveryKey', {
1183
1400
  Code: code
1184
1401
  });
1185
1402
  case 2:
1186
- return _context33.a(2);
1403
+ return _context31.a(2);
1187
1404
  }
1188
- }, _callee33);
1405
+ }, _callee31);
1189
1406
  })));
1190
- it('should dispatch `showSnack` with warning if `Authenticated` = false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34() {
1407
+ it('should dispatch `showSnack` with warning if `Authenticated` = false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee32() {
1191
1408
  var code, errormsg;
1192
- return _regenerator().w(function (_context34) {
1193
- while (1) switch (_context34.n) {
1409
+ return _regenerator().w(function (_context32) {
1410
+ while (1) switch (_context32.n) {
1194
1411
  case 0:
1195
1412
  code = 123212;
1196
1413
  errormsg = 'False';
@@ -1200,7 +1417,7 @@ describe('userActions', function () {
1200
1417
  errormsg: errormsg
1201
1418
  })
1202
1419
  }));
1203
- _context34.n = 1;
1420
+ _context32.n = 1;
1204
1421
  return actions.getGoogle2FARecoveryCode(code)(dispatchStub);
1205
1422
  case 1:
1206
1423
  expect(snackbarActions.showSnack).toHaveBeenCalledWith({
@@ -1209,14 +1426,14 @@ describe('userActions', function () {
1209
1426
  type: 'warning'
1210
1427
  });
1211
1428
  case 2:
1212
- return _context34.a(2);
1429
+ return _context32.a(2);
1213
1430
  }
1214
- }, _callee34);
1431
+ }, _callee32);
1215
1432
  })));
1216
- it('should dispatch `change` with code if `Authenticated` = true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35() {
1433
+ it('should dispatch `change` with code if `Authenticated` = true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee33() {
1217
1434
  var code, RecoveryKey;
1218
- return _regenerator().w(function (_context35) {
1219
- while (1) switch (_context35.n) {
1435
+ return _regenerator().w(function (_context33) {
1436
+ while (1) switch (_context33.n) {
1220
1437
  case 0:
1221
1438
  code = 123212;
1222
1439
  RecoveryKey = 123123;
@@ -1226,14 +1443,14 @@ describe('userActions', function () {
1226
1443
  RecoveryKey: RecoveryKey
1227
1444
  })
1228
1445
  }));
1229
- _context35.n = 1;
1446
+ _context33.n = 1;
1230
1447
  return actions.getGoogle2FARecoveryCode(code)(dispatchStub);
1231
1448
  case 1:
1232
1449
  expect(_reduxForm.change).toHaveBeenCalledWith('google2FARecoveryKeyModal', 'recoveryKey', RecoveryKey);
1233
1450
  case 2:
1234
- return _context35.a(2);
1451
+ return _context33.a(2);
1235
1452
  }
1236
- }, _callee35);
1453
+ }, _callee33);
1237
1454
  })));
1238
1455
  });
1239
1456
  describe('updateUserConfig', function () {
@@ -1312,8 +1529,16 @@ describe('userActions', function () {
1312
1529
  userInfo: {
1313
1530
  UserName: 'k-stas'
1314
1531
  }
1532
+ },
1533
+ api: {
1534
+ validate2FARequiredEndpoints: {}
1315
1535
  }
1316
1536
  });
1537
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('ResetPassword', {
1538
+ o: JSON.stringify({
1539
+ result: true
1540
+ })
1541
+ });
1317
1542
  store.dispatch(actions.submitResetPasswordForm());
1318
1543
  expect(store.getActions()).toEqual([]);
1319
1544
  });
@@ -1322,37 +1547,41 @@ describe('userActions', function () {
1322
1547
  beforeEach(function () {
1323
1548
  jest.clearAllMocks();
1324
1549
  });
1325
- it('should dispatch `sendResetPasswordEmail` and showSnack if response result is true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee36() {
1326
- return _regenerator().w(function (_context36) {
1327
- while (1) switch (_context36.n) {
1550
+ it('should dispatch `sendResetPasswordEmail` and showSnack if response result is true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34() {
1551
+ return _regenerator().w(function (_context34) {
1552
+ while (1) switch (_context34.n) {
1328
1553
  case 0:
1329
- _apex["default"].connection.setResponse({
1330
- result: true
1554
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('ResetPassword', {
1555
+ o: JSON.stringify({
1556
+ result: true
1557
+ })
1331
1558
  });
1332
- _context36.n = 1;
1559
+ _context34.n = 1;
1333
1560
  return store.dispatch(actions.sendResetPasswordEmail());
1334
1561
  case 1:
1335
1562
  expect(snackbarActions.showSnack).toHaveBeenCalled();
1336
1563
  case 2:
1337
- return _context36.a(2);
1564
+ return _context34.a(2);
1338
1565
  }
1339
- }, _callee36);
1566
+ }, _callee34);
1340
1567
  })));
1341
- it('should dispatch `sendResetPasswordEmail` and showSnack if response result is false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee37() {
1342
- return _regenerator().w(function (_context37) {
1343
- while (1) switch (_context37.n) {
1568
+ it('should dispatch `sendResetPasswordEmail` and showSnack if response result is false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35() {
1569
+ return _regenerator().w(function (_context35) {
1570
+ while (1) switch (_context35.n) {
1344
1571
  case 0:
1345
- _apex["default"].connection.setResponse({
1346
- result: false
1572
+ _apex["default"].connection.setRPCPromiseReturnValueForEndpoint('ResetPassword', {
1573
+ o: JSON.stringify({
1574
+ result: false
1575
+ })
1347
1576
  });
1348
- _context37.n = 1;
1577
+ _context35.n = 1;
1349
1578
  return store.dispatch(actions.sendResetPasswordEmail());
1350
1579
  case 1:
1351
1580
  expect(snackbarActions.showSnack).toHaveBeenCalled();
1352
1581
  case 2:
1353
- return _context37.a(2);
1582
+ return _context35.a(2);
1354
1583
  }
1355
- }, _callee37);
1584
+ }, _callee35);
1356
1585
  })));
1357
1586
  });
1358
1587
  describe('resendVerificationEmail', function () {
@@ -1361,51 +1590,56 @@ describe('userActions', function () {
1361
1590
  jest.clearAllMocks();
1362
1591
  store = mockStore({});
1363
1592
  });
1364
- it('should dispatch showSnack if response result is true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee38() {
1365
- return _regenerator().w(function (_context38) {
1366
- while (1) switch (_context38.n) {
1593
+ it('should dispatch showSnack if response result is true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee36() {
1594
+ return _regenerator().w(function (_context36) {
1595
+ while (1) switch (_context36.n) {
1367
1596
  case 0:
1368
1597
  _apex["default"].connection.setResponse({
1369
1598
  result: true
1370
1599
  });
1371
- _context38.n = 1;
1600
+ _context36.n = 1;
1372
1601
  return store.dispatch(actions.resendVerificationEmail());
1373
1602
  case 1:
1374
1603
  expect(snackbarActions.showSnack).toHaveBeenCalled();
1375
1604
  case 2:
1376
- return _context38.a(2);
1605
+ return _context36.a(2);
1377
1606
  }
1378
- }, _callee38);
1607
+ }, _callee36);
1379
1608
  })));
1380
- it('should dispatch showSnack if response result is false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee39() {
1381
- return _regenerator().w(function (_context39) {
1382
- while (1) switch (_context39.n) {
1609
+ it('should dispatch showSnack if response result is false', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee37() {
1610
+ return _regenerator().w(function (_context37) {
1611
+ while (1) switch (_context37.n) {
1383
1612
  case 0:
1384
1613
  _apex["default"].connection.setResponse({
1385
1614
  result: false
1386
1615
  });
1387
- _context39.n = 1;
1616
+ _context37.n = 1;
1388
1617
  return store.dispatch(actions.resendVerificationEmail());
1389
1618
  case 1:
1390
1619
  expect(snackbarActions.showSnack).toHaveBeenCalled();
1391
1620
  case 2:
1392
- return _context39.a(2);
1621
+ return _context37.a(2);
1393
1622
  }
1394
- }, _callee39);
1623
+ }, _callee37);
1395
1624
  })));
1396
- it('should dispatch showSnack if apex.connection is not include ResendVerificationEmail', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee40() {
1397
- return _regenerator().w(function (_context40) {
1398
- while (1) switch (_context40.n) {
1625
+ it('should dispatch showSnack if apex.connection is not include ResendVerificationEmail', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee38() {
1626
+ var _apex$connection, ResendVerificationEmail, connectionWithoutResendVerificationEmail;
1627
+ return _regenerator().w(function (_context38) {
1628
+ while (1) switch (_context38.n) {
1399
1629
  case 0:
1400
- _apex["default"].connection = {};
1401
- _context40.n = 1;
1630
+ _apex$connection = _apex["default"].connection, ResendVerificationEmail = _apex$connection.ResendVerificationEmail, connectionWithoutResendVerificationEmail = _objectWithoutProperties(_apex$connection, _excluded);
1631
+ _apex["default"].connection = connectionWithoutResendVerificationEmail;
1632
+ _context38.n = 1;
1402
1633
  return store.dispatch(actions.resendVerificationEmail());
1403
1634
  case 1:
1404
1635
  expect(snackbarActions.showSnack).toHaveBeenCalled();
1636
+ _apex["default"].connection = _objectSpread(_objectSpread({}, _apex["default"].connection), {}, {
1637
+ ResendVerificationEmail: ResendVerificationEmail
1638
+ });
1405
1639
  case 2:
1406
- return _context40.a(2);
1640
+ return _context38.a(2);
1407
1641
  }
1408
- }, _callee40);
1642
+ }, _callee38);
1409
1643
  })));
1410
1644
  });
1411
1645
  describe('goToResetPasswordFormStep', function () {