diff options
author | TrejGun <trejgun@gmail.com> | 2018-07-05 11:34:13 +0800 |
---|---|---|
committer | TrejGun <trejgun@gmail.com> | 2018-07-05 11:34:13 +0800 |
commit | 94d1d846fb57932fd1e959f53dbf6444f0789e91 (patch) | |
tree | 369276cd66bdcae85cac77b2c9b2458de5b08dd7 /test/unit/app/controllers/transactions/tx-state-history-helper-test.js | |
parent | c94f639de55a867ebe8d3599d337a1f7341b1979 (diff) | |
parent | fd218142acb6dab0b2f921b9729f17ff90cffc2d (diff) | |
download | tangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.tar.gz tangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.tar.zst tangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.zip |
Merge branch 'develop' into contextTypes
# Conflicts:
# ui/app/components/send_/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js
Diffstat (limited to 'test/unit/app/controllers/transactions/tx-state-history-helper-test.js')
-rw-r--r-- | test/unit/app/controllers/transactions/tx-state-history-helper-test.js | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/test/unit/app/controllers/transactions/tx-state-history-helper-test.js b/test/unit/app/controllers/transactions/tx-state-history-helper-test.js index f4c3a6be1..fba0e7fda 100644 --- a/test/unit/app/controllers/transactions/tx-state-history-helper-test.js +++ b/test/unit/app/controllers/transactions/tx-state-history-helper-test.js @@ -2,16 +2,16 @@ const assert = require('assert') const txStateHistoryHelper = require('../../../../../app/scripts/controllers/transactions/lib/tx-state-history-helper') const testVault = require('../../../../data/v17-long-history.json') -describe ('Transaction state history helper', function () { +describe('Transaction state history helper', function () { describe('#snapshotFromTxMeta', function () { it('should clone deep', function () { const input = { foo: { bar: { - bam: 'baz' - } - } + bam: 'baz', + }, + }, } const output = txStateHistoryHelper.snapshotFromTxMeta(input) assert('foo' in output, 'has a foo key') @@ -50,14 +50,14 @@ describe ('Transaction state history helper', function () { it('replaying history does not mutate the original obj', function () { const initialState = { test: true, message: 'hello', value: 1 } const diff1 = [{ - "op": "replace", - "path": "/message", - "value": "haay", + 'op': 'replace', + 'path': '/message', + 'value': 'haay', }] const diff2 = [{ - "op": "replace", - "path": "/value", - "value": 2, + 'op': 'replace', + 'path': '/value', + 'value': 2, }] const history = [initialState, diff1, diff2] @@ -72,15 +72,15 @@ describe ('Transaction state history helper', function () { describe('#generateHistoryEntry', function () { - function generateHistoryEntryTest(note) { + function generateHistoryEntryTest (note) { const prevState = { someValue: 'value 1', foo: { bar: { - bam: 'baz' - } - } + bam: 'baz', + }, + }, } const nextState = { @@ -89,9 +89,9 @@ describe ('Transaction state history helper', function () { foo: { newPropFirstLevel: 'new property - first level', bar: { - bam: 'baz' - } - } + bam: 'baz', + }, + }, } const before = new Date().getTime() @@ -106,8 +106,7 @@ describe ('Transaction state history helper', function () { assert.equal(result[0].path, expectedEntry1.path) assert.equal(result[0].value, expectedEntry1.value) assert.equal(result[0].value, expectedEntry1.value) - if (note) - assert.equal(result[0].note, note) + if (note) { assert.equal(result[0].note, note) } assert.ok(result[0].timestamp >= before && result[0].timestamp <= after) @@ -124,6 +123,6 @@ describe ('Transaction state history helper', function () { it('should add note to first entry', function () { generateHistoryEntryTest('custom note') - }) + }) }) -})
\ No newline at end of file +}) |