aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-01-09 07:16:08 +0800
committerDan Finlay <dan@danfinlay.com>2018-01-09 07:16:08 +0800
commit943befef91cd725579c4bf4e7024734f02ef98f5 (patch)
tree38602c7e5f7c2ea0b32fd9bc04ff321b786ead71
parent0275231e13d49a9b71b85af389d2a9850229eacb (diff)
downloadtangerine-wallet-browser-943befef91cd725579c4bf4e7024734f02ef98f5.tar
tangerine-wallet-browser-943befef91cd725579c4bf4e7024734f02ef98f5.tar.gz
tangerine-wallet-browser-943befef91cd725579c4bf4e7024734f02ef98f5.tar.bz2
tangerine-wallet-browser-943befef91cd725579c4bf4e7024734f02ef98f5.tar.lz
tangerine-wallet-browser-943befef91cd725579c4bf4e7024734f02ef98f5.tar.xz
tangerine-wallet-browser-943befef91cd725579c4bf4e7024734f02ef98f5.tar.zst
tangerine-wallet-browser-943befef91cd725579c4bf4e7024734f02ef98f5.zip
Add test for gas estimate default
-rw-r--r--test/unit/metamask-controller-test.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/metamask-controller-test.js b/test/unit/metamask-controller-test.js
index 9ec7cd0af..3fc7f9a98 100644
--- a/test/unit/metamask-controller-test.js
+++ b/test/unit/metamask-controller-test.js
@@ -72,6 +72,25 @@ describe('MetaMaskController', function () {
metamaskController.recentBlocksController = realRecentBlocksController
})
+
+ it('gives the 1 gwei price if no blocks have been seen.', async function () {
+ const realRecentBlocksController = metamaskController.recentBlocksController
+ metamaskController.recentBlocksController = {
+ store: {
+ getState: () => {
+ return {
+ recentBlocks: []
+ }
+ }
+ }
+ }
+
+ const gasPrice = metamaskController.getGasPrice()
+ assert.equal(gasPrice, '0x' + GWEI_BN.toString(16), 'defaults to 1 gwei')
+
+ metamaskController.recentBlocksController = realRecentBlocksController
+ })
+
})
describe('#createNewVaultAndKeychain', function () {