diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2018-10-10 22:32:26 +0800 |
---|---|---|
committer | kumavis <kumavis@users.noreply.github.com> | 2018-10-10 22:32:26 +0800 |
commit | b45479934dadd8a4177b51b81732ab15f3226b93 (patch) | |
tree | 8a0976496054c278e2014711ef7c4f289b26ad2e /ui/app | |
parent | 70fc093b21f733b182654c38e51b14c6bf726cbc (diff) | |
download | tangerine-wallet-browser-b45479934dadd8a4177b51b81732ab15f3226b93.tar tangerine-wallet-browser-b45479934dadd8a4177b51b81732ab15f3226b93.tar.gz tangerine-wallet-browser-b45479934dadd8a4177b51b81732ab15f3226b93.tar.bz2 tangerine-wallet-browser-b45479934dadd8a4177b51b81732ab15f3226b93.tar.lz tangerine-wallet-browser-b45479934dadd8a4177b51b81732ab15f3226b93.tar.xz tangerine-wallet-browser-b45479934dadd8a4177b51b81732ab15f3226b93.tar.zst tangerine-wallet-browser-b45479934dadd8a4177b51b81732ab15f3226b93.zip |
test - add actions unit tests (#5369)
* Actions.spec.js
* Error handling tests
* Lint
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/actions.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 8f6586139..eea581d33 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -1762,7 +1762,7 @@ function markNoticeRead (notice) { background.markNoticeRead(notice, (err, notice) => { dispatch(actions.hideLoadingIndication()) if (err) { - dispatch(actions.displayWarning(err)) + dispatch(actions.displayWarning(err.message)) return reject(err) } @@ -1852,7 +1852,7 @@ function setProviderType (type) { background.setProviderType(type, (err, result) => { if (err) { log.error(err) - return dispatch(self.displayWarning('Had a problem changing networks!')) + return dispatch(actions.displayWarning('Had a problem changing networks!')) } dispatch(actions.updateProviderType(type)) dispatch(actions.setSelectedToken()) @@ -1874,7 +1874,7 @@ function setRpcTarget (newRpc) { background.setCustomRpc(newRpc, (err, result) => { if (err) { log.error(err) - return dispatch(self.displayWarning('Had a problem changing networks!')) + return dispatch(actions.displayWarning('Had a problem changing networks!')) } dispatch(actions.setSelectedToken()) }) @@ -2309,6 +2309,10 @@ function updateNetworkNonce (address) { return (dispatch) => { return new Promise((resolve, reject) => { global.ethQuery.getTransactionCount(address, (err, data) => { + if (err) { + dispatch(actions.displayWarning(err.message)) + return reject(err) + } dispatch(setNetworkNonce(data)) resolve(data) }) @@ -2396,7 +2400,7 @@ function setUseBlockie (val) { function updateCurrentLocale (key) { return (dispatch) => { dispatch(actions.showLoadingIndication()) - fetchLocale(key) + return fetchLocale(key) .then((localeMessages) => { log.debug(`background.setCurrentLocale`) background.setCurrentLocale(key, (err) => { |