diff options
Diffstat (limited to 'ui/app/helpers/tests/transactions.util.test.js')
-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) + }) + }) + }) }) |