diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-08-30 07:36:19 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-08-30 07:36:19 +0800 |
commit | ae8486d5cfa2c1d173e0c675408cc6bc00729bd3 (patch) | |
tree | ec01718a70d72e7961953556c03b24855474cacd /test | |
parent | 056276af02c5717684e36eeeaf6a8787ea4a39e6 (diff) | |
parent | 71de68fc13d83934e8bc81ba43574a946bc32159 (diff) | |
download | tangerine-wallet-browser-ae8486d5cfa2c1d173e0c675408cc6bc00729bd3.tar tangerine-wallet-browser-ae8486d5cfa2c1d173e0c675408cc6bc00729bd3.tar.gz tangerine-wallet-browser-ae8486d5cfa2c1d173e0c675408cc6bc00729bd3.tar.bz2 tangerine-wallet-browser-ae8486d5cfa2c1d173e0c675408cc6bc00729bd3.tar.lz tangerine-wallet-browser-ae8486d5cfa2c1d173e0c675408cc6bc00729bd3.tar.xz tangerine-wallet-browser-ae8486d5cfa2c1d173e0c675408cc6bc00729bd3.tar.zst tangerine-wallet-browser-ae8486d5cfa2c1d173e0c675408cc6bc00729bd3.zip |
Merge branch 'master' into new-currency-test
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/tx-state-history-helper-test.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/tx-state-history-helper-test.js b/test/unit/tx-state-history-helper-test.js new file mode 100644 index 000000000..90cb10713 --- /dev/null +++ b/test/unit/tx-state-history-helper-test.js @@ -0,0 +1,26 @@ +const assert = require('assert') +const clone = require('clone') +const txStateHistoryHelper = require('../../app/scripts/lib/tx-state-history-helper') + +describe('deepCloneFromTxMeta', function () { + it('should clone deep', function () { + const input = { + foo: { + bar: { + bam: 'baz' + } + } + } + const output = txStateHistoryHelper.snapshotFromTxMeta(input) + assert('foo' in output, 'has a foo key') + assert('bar' in output.foo, 'has a bar key') + assert('bam' in output.foo.bar, 'has a bar key') + assert.equal(output.foo.bar.bam, 'baz', 'has a baz value') + }) + + it('should remove the history key', function () { + const input = { foo: 'bar', history: 'remembered' } + const output = txStateHistoryHelper.snapshotFromTxMeta(input) + assert(typeof output.history, 'undefined', 'should remove history') + }) +}) |