diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-09-06 00:03:44 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-09-06 00:03:44 +0800 |
commit | e647337a8a34d8fb4b5a8081888ec32ce5fd27a0 (patch) | |
tree | 2060fcf05407d4cec876332a70d25418237a724d /test/unit/tx-state-history-helper-test.js | |
parent | 45fc1d6ec356232e51fe4a9cc1f01929e35e8014 (diff) | |
parent | 2885a9547187ce1ad0fb3bed1935387d901942a8 (diff) | |
download | tangerine-wallet-browser-e647337a8a34d8fb4b5a8081888ec32ce5fd27a0.tar tangerine-wallet-browser-e647337a8a34d8fb4b5a8081888ec32ce5fd27a0.tar.gz tangerine-wallet-browser-e647337a8a34d8fb4b5a8081888ec32ce5fd27a0.tar.bz2 tangerine-wallet-browser-e647337a8a34d8fb4b5a8081888ec32ce5fd27a0.tar.lz tangerine-wallet-browser-e647337a8a34d8fb4b5a8081888ec32ce5fd27a0.tar.xz tangerine-wallet-browser-e647337a8a34d8fb4b5a8081888ec32ce5fd27a0.tar.zst tangerine-wallet-browser-e647337a8a34d8fb4b5a8081888ec32ce5fd27a0.zip |
Resolve merge conflict from master
Diffstat (limited to 'test/unit/tx-state-history-helper-test.js')
-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') + }) +}) |