diff options
author | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-10-16 06:00:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-16 06:00:47 +0800 |
commit | c821a8354c8eba05885ca219f39aedafbd4f8052 (patch) | |
tree | 880b60c46a0c3f0873a58f16077623211140ac0e /ui/app/helpers/tests | |
parent | 61dec4ea464607d32a5727bdf343a7d8a9af66fc (diff) | |
download | tangerine-wallet-browser-c821a8354c8eba05885ca219f39aedafbd4f8052.tar tangerine-wallet-browser-c821a8354c8eba05885ca219f39aedafbd4f8052.tar.gz tangerine-wallet-browser-c821a8354c8eba05885ca219f39aedafbd4f8052.tar.bz2 tangerine-wallet-browser-c821a8354c8eba05885ca219f39aedafbd4f8052.tar.lz tangerine-wallet-browser-c821a8354c8eba05885ca219f39aedafbd4f8052.tar.xz tangerine-wallet-browser-c821a8354c8eba05885ca219f39aedafbd4f8052.tar.zst tangerine-wallet-browser-c821a8354c8eba05885ca219f39aedafbd4f8052.zip |
Add txReceipt data to transaction details (#5513)
Diffstat (limited to 'ui/app/helpers/tests')
-rw-r--r-- | ui/app/helpers/tests/transactions.util.test.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ui/app/helpers/tests/transactions.util.test.js b/ui/app/helpers/tests/transactions.util.test.js index 103a84a8c..838522e35 100644 --- a/ui/app/helpers/tests/transactions.util.test.js +++ b/ui/app/helpers/tests/transactions.util.test.js @@ -19,4 +19,39 @@ describe('Transactions utils', () => { assert.doesNotThrow(() => utils.getTokenData()) }) }) + + describe('getStatusKey', () => { + it('should return the correct status', () => { + const tests = [ + { + transaction: { + status: 'confirmed', + txReceipt: { + status: '0x0', + }, + }, + expected: 'failed', + }, + { + transaction: { + status: 'confirmed', + txReceipt: { + status: '0x1', + }, + }, + expected: 'confirmed', + }, + { + transaction: { + status: 'pending', + }, + expected: 'pending', + }, + ] + + tests.forEach(({ transaction, expected }) => { + assert.equal(utils.getStatusKey(transaction), expected) + }) + }) + }) }) |