aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/components
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-07-15 14:36:42 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-07-18 04:38:15 +0800
commite16f5ab54d1e69e59fe4689fde3fa34e61c88974 (patch)
tree1d453ccf911aa8e6deeb590ac54dde2b08c4042e /test/unit/components
parentd19c42fcaeea933793ed459ab5248b42811a0498 (diff)
downloadtangerine-wallet-browser-e16f5ab54d1e69e59fe4689fde3fa34e61c88974.tar
tangerine-wallet-browser-e16f5ab54d1e69e59fe4689fde3fa34e61c88974.tar.gz
tangerine-wallet-browser-e16f5ab54d1e69e59fe4689fde3fa34e61c88974.tar.bz2
tangerine-wallet-browser-e16f5ab54d1e69e59fe4689fde3fa34e61c88974.tar.lz
tangerine-wallet-browser-e16f5ab54d1e69e59fe4689fde3fa34e61c88974.tar.xz
tangerine-wallet-browser-e16f5ab54d1e69e59fe4689fde3fa34e61c88974.tar.zst
tangerine-wallet-browser-e16f5ab54d1e69e59fe4689fde3fa34e61c88974.zip
Fix tests
Diffstat (limited to 'test/unit/components')
-rw-r--r--test/unit/components/pending-tx-test.js67
1 files changed, 0 insertions, 67 deletions
diff --git a/test/unit/components/pending-tx-test.js b/test/unit/components/pending-tx-test.js
deleted file mode 100644
index c68e013ac..000000000
--- a/test/unit/components/pending-tx-test.js
+++ /dev/null
@@ -1,67 +0,0 @@
-const assert = require('assert')
-const h = require('react-hyperscript')
-const PendingTx = require('../../../ui/app/components/pending-tx')
-const ethUtil = require('ethereumjs-util')
-
-const { createMockStore } = require('redux-test-utils')
-const { shallowWithStore } = require('../../lib/shallow-with-store')
-
-const identities = { abc: {}, def: {} }
-const mockState = {
- metamask: {
- accounts: { abc: {} },
- identities,
- conversionRate: 10,
- selectedAddress: 'abc',
- },
-}
-
-describe('PendingTx', function () {
- const gasPrice = '0x4A817C800' // 20 Gwei
- const txData = {
- 'id': 5021615666270214,
- 'time': 1494458763011,
- 'status': 'unapproved',
- 'metamaskNetworkId': '1494442339676',
- 'txParams': {
- 'from': '0xfdea65c8e26263f6d9a1b5de9555d2931a33b826',
- 'to': '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb',
- 'value': '0xde0b6b3a7640000',
- gasPrice,
- 'gas': '0x7b0c',
- },
- 'gasLimitSpecified': false,
- 'estimatedGas': '0x5208',
- }
- const newGasPrice = '0x77359400'
-
- const computedBalances = {}
- computedBalances[Object.keys(identities)[0]] = {
- ethBalance: '0x00000000000000056bc75e2d63100000',
- }
- const props = {
- txData,
- computedBalances,
- sendTransaction: (txMeta, event) => {
- // Assert changes:
- const result = ethUtil.addHexPrefix(txMeta.txParams.gasPrice)
- assert.notEqual(result, gasPrice, 'gas price should change')
- assert.equal(result, newGasPrice, 'gas price assigned.')
- },
- }
-
- let pendingTxComponent
- let store
- let component
- beforeEach(function () {
- store = createMockStore(mockState)
- component = shallowWithStore(h(PendingTx, props), store)
- pendingTxComponent = component
- })
-
- it('should render correctly', function (done) {
- assert.equal(pendingTxComponent.props().identities, identities)
- done()
- })
-})
-