diff options
author | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-09-13 11:07:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-13 11:07:59 +0800 |
commit | 16d6cd5eb90e9720799f9a69e9c4e7d66d2fa89b (patch) | |
tree | f497f9f7d991b290f48cf7e5120a2f2e95d8f81f /ui/app/components/transaction-list-item-details/tests | |
parent | 014240b066585f5983a4e6d65d6223f235044380 (diff) | |
parent | f1a309e0cc110060cc56252ec5f7626ca6403fab (diff) | |
download | tangerine-wallet-browser-16d6cd5eb90e9720799f9a69e9c4e7d66d2fa89b.tar.gz tangerine-wallet-browser-16d6cd5eb90e9720799f9a69e9c4e7d66d2fa89b.tar.zst tangerine-wallet-browser-16d6cd5eb90e9720799f9a69e9c4e7d66d2fa89b.zip |
Merge pull request #5182 from MetaMask/tx-activity
Add Transaction Details to the Transaction List view
Diffstat (limited to 'ui/app/components/transaction-list-item-details/tests')
-rw-r--r-- | ui/app/components/transaction-list-item-details/tests/transaction-list-item-details.component.test.js | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/ui/app/components/transaction-list-item-details/tests/transaction-list-item-details.component.test.js b/ui/app/components/transaction-list-item-details/tests/transaction-list-item-details.component.test.js new file mode 100644 index 000000000..f2bbe8789 --- /dev/null +++ b/ui/app/components/transaction-list-item-details/tests/transaction-list-item-details.component.test.js @@ -0,0 +1,66 @@ +import React from 'react' +import assert from 'assert' +import { shallow } from 'enzyme' +import TransactionListItemDetails from '../transaction-list-item-details.component' +import Button from '../../button' +import SenderToRecipient from '../../sender-to-recipient' +import TransactionBreakdown from '../../transaction-breakdown' +import TransactionActivityLog from '../../transaction-activity-log' + +describe('TransactionListItemDetails 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( + <TransactionListItemDetails + transaction={transaction} + />, + { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } } + ) + + assert.ok(wrapper.hasClass('transaction-list-item-details')) + assert.equal(wrapper.find(Button).length, 1) + assert.equal(wrapper.find(SenderToRecipient).length, 1) + assert.equal(wrapper.find(TransactionBreakdown).length, 1) + assert.equal(wrapper.find(TransactionActivityLog).length, 1) + }) + + it('should render a retry button', () => { + const transaction = { + history: [], + id: 1, + status: 'confirmed', + txParams: { + from: '0x1', + gas: '0x5208', + gasPrice: '0x3b9aca00', + nonce: '0xa4', + to: '0x2', + value: '0x2386f26fc10000', + }, + } + + const wrapper = shallow( + <TransactionListItemDetails + transaction={transaction} + showRetry={true} + />, + { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } } + ) + + assert.ok(wrapper.hasClass('transaction-list-item-details')) + assert.equal(wrapper.find(Button).length, 2) + }) +}) |