diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-09-01 03:36:07 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-09-13 10:48:52 +0800 |
commit | fd51ab12298e93286eeaf03c60e0b4e8d5d1bad3 (patch) | |
tree | 69e43bf265b933a158a9ab6e5251df2109f31ea7 /ui/app/components/transaction-breakdown/tests | |
parent | 084158f1a2af9d117c054420e895f4ae76a94df0 (diff) | |
download | tangerine-wallet-browser-fd51ab12298e93286eeaf03c60e0b4e8d5d1bad3.tar.gz tangerine-wallet-browser-fd51ab12298e93286eeaf03c60e0b4e8d5d1bad3.tar.zst tangerine-wallet-browser-fd51ab12298e93286eeaf03c60e0b4e8d5d1bad3.zip |
Add TransactionBreakdown component
Diffstat (limited to 'ui/app/components/transaction-breakdown/tests')
-rw-r--r-- | ui/app/components/transaction-breakdown/tests/transaction-breakdown.component.test.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ui/app/components/transaction-breakdown/tests/transaction-breakdown.component.test.js b/ui/app/components/transaction-breakdown/tests/transaction-breakdown.component.test.js new file mode 100644 index 000000000..d18cd420c --- /dev/null +++ b/ui/app/components/transaction-breakdown/tests/transaction-breakdown.component.test.js @@ -0,0 +1,37 @@ +import React from 'react' +import assert from 'assert' +import { shallow } from 'enzyme' +import TransactionBreakdown from '../transaction-breakdown.component' +import TransactionBreakdownRow from '../transaction-breakdown-row' +import Card from '../../card' + +describe('TransactionBreakdown Component', () => { + it('should render properly', () => { + const transaction = { + history: [], + id: 1, + status: 'confirmed', + txParams: { + from: '0x1', + gas: '0x5208', + gasPrice: '0x3b9aca00', + nonce: '0xa4', + to: '0x2', + value: '0x2386f26fc10000', + }, + } + + const wrapper = shallow( + <TransactionBreakdown + transaction={transaction} + className="test-class" + />, + { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } } + ) + + assert.ok(wrapper.hasClass('transaction-breakdown')) + assert.ok(wrapper.hasClass('test-class')) + assert.equal(wrapper.find(Card).length, 1) + assert.equal(wrapper.find(Card).find(TransactionBreakdownRow).length, 4) + }) +}) |