aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/app/controllers/detect-tokens-test.js16
-rw-r--r--test/unit/app/controllers/transactions/pending-tx-test.js90
-rw-r--r--test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js4
-rw-r--r--test/unit/app/controllers/transactions/tx-controller-test.js100
-rw-r--r--test/unit/app/controllers/transactions/tx-state-manager-test.js12
-rw-r--r--test/unit/app/controllers/transactions/tx-utils-test.js2
-rw-r--r--test/unit/app/edge-encryptor-test.js32
-rw-r--r--test/unit/localhostState.js10
-rw-r--r--test/unit/migrations/021-test.js12
-rw-r--r--test/unit/migrations/022-test.js22
-rw-r--r--test/unit/migrations/023-test.js44
-rw-r--r--test/unit/migrations/024-test.js24
-rw-r--r--test/unit/migrations/025-test.js24
-rw-r--r--test/unit/migrations/029-test.js24
-rw-r--r--test/unit/migrations/030-test.js16
-rw-r--r--test/unit/migrations/031-test.js8
-rw-r--r--test/unit/migrations/migrations-test.js154
-rw-r--r--test/unit/migrations/migrator-test.js22
-rw-r--r--test/unit/migrations/template-test.js8
-rw-r--r--test/unit/ui/app/actions.spec.js2
20 files changed, 313 insertions, 313 deletions
diff --git a/test/unit/app/controllers/detect-tokens-test.js b/test/unit/app/controllers/detect-tokens-test.js
index 2acc53e92..8f18406f4 100644
--- a/test/unit/app/controllers/detect-tokens-test.js
+++ b/test/unit/app/controllers/detect-tokens-test.js
@@ -71,8 +71,8 @@ describe('DetectTokensController', () => {
controller.isUnlocked = true
var stub = sandbox.stub(controller, 'detectTokenBalance')
- .withArgs('0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4').returns(true)
- .withArgs('0xBC86727E770de68B1060C91f6BB6945c73e10388').returns(true)
+ .withArgs('0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4').returns(true)
+ .withArgs('0xBC86727E770de68B1060C91f6BB6945c73e10388').returns(true)
await controller.detectNewTokens()
sandbox.assert.notCalled(stub)
@@ -84,14 +84,14 @@ describe('DetectTokensController', () => {
controller.isUnlocked = true
sandbox.stub(controller, 'detectTokenBalance')
- .withArgs('0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4')
- .returns(preferences.addToken('0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', 'J8T', 8))
- .withArgs('0xBC86727E770de68B1060C91f6BB6945c73e10388')
- .returns(preferences.addToken('0xbc86727e770de68b1060c91f6bb6945c73e10388', 'XNK', 18))
+ .withArgs('0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4')
+ .returns(preferences.addToken('0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', 'J8T', 8))
+ .withArgs('0xBC86727E770de68B1060C91f6BB6945c73e10388')
+ .returns(preferences.addToken('0xbc86727e770de68b1060c91f6bb6945c73e10388', 'XNK', 18))
await controller.detectNewTokens()
assert.deepEqual(preferences.store.getState().tokens, [{address: '0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', decimals: 8, symbol: 'J8T'},
- {address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK'}])
+ {address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK'}])
})
it('should not detect same token while in main network', async () => {
@@ -108,7 +108,7 @@ describe('DetectTokensController', () => {
await controller.detectNewTokens()
assert.deepEqual(preferences.store.getState().tokens, [{address: '0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', decimals: 8, symbol: 'J8T'},
- {address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK'}])
+ {address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK'}])
})
it('should trigger detect new tokens when change address', async () => {
diff --git a/test/unit/app/controllers/transactions/pending-tx-test.js b/test/unit/app/controllers/transactions/pending-tx-test.js
index b37ac2766..e1de5731b 100644
--- a/test/unit/app/controllers/transactions/pending-tx-test.js
+++ b/test/unit/app/controllers/transactions/pending-tx-test.js
@@ -7,7 +7,7 @@ const sinon = require('sinon')
describe('PendingTransactionTracker', function () {
let pendingTxTracker, txMeta, txMetaNoHash, providerResultStub,
- provider, txMeta3, txList, knownErrors
+ provider, txMeta3, txList, knownErrors
this.timeout(10000)
beforeEach(function () {
@@ -80,7 +80,7 @@ describe('PendingTransactionTracker', function () {
}, { count: 1 })[0]
stub = sinon.stub(pendingTxTracker, 'getCompletedTransactions')
- .returns(txGen.txs)
+ .returns(txGen.txs)
// THE EXPECTATION
const spy = sinon.spy()
@@ -107,18 +107,18 @@ describe('PendingTransactionTracker', function () {
})
it('should emit tx:dropped with the txMetas id only after the second call', function (done) {
- txMeta = {
- id: 1,
- hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
- status: 'submitted',
- txParams: {
- from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
- nonce: '0x1',
- value: '0xfffff',
- },
- history: [{}],
- rawTx: '0xf86c808504a817c800827b0d940c62bb85faa3311a998d3aba8098c1235c564966880de0b6b3a7640000802aa08ff665feb887a25d4099e40e11f0fef93ee9608f404bd3f853dd9e84ed3317a6a02ec9d3d1d6e176d4d2593dd760e74ccac753e6a0ea0d00cc9789d0d7ff1f471d',
- }
+ txMeta = {
+ id: 1,
+ hash: '0x0593ee121b92e10d63150ad08b4b8f9c7857d1bd160195ee648fb9a0f8d00eeb',
+ status: 'submitted',
+ txParams: {
+ from: '0x1678a085c290ebd122dc42cba69373b5953b831d',
+ nonce: '0x1',
+ value: '0xfffff',
+ },
+ history: [{}],
+ rawTx: '0xf86c808504a817c800827b0d940c62bb85faa3311a998d3aba8098c1235c564966880de0b6b3a7640000802aa08ff665feb887a25d4099e40e11f0fef93ee9608f404bd3f853dd9e84ed3317a6a02ec9d3d1d6e176d4d2593dd760e74ccac753e6a0ea0d00cc9789d0d7ff1f471d',
+ }
providerResultStub['eth_getTransactionCount'] = '0x02'
providerResultStub['eth_getTransactionByHash'] = {}
@@ -159,8 +159,8 @@ describe('PendingTransactionTracker', function () {
pendingTxTracker.getPendingTransactions = () => txList
pendingTxTracker._checkPendingTx = (tx) => { tx.resolve(tx) }
Promise.all(txList.map((tx) => tx.processed))
- .then(() => done())
- .catch(done)
+ .then(() => done())
+ .catch(done)
pendingTxTracker.updatePendingTxs()
})
@@ -169,8 +169,8 @@ describe('PendingTransactionTracker', function () {
describe('#resubmitPendingTxs', function () {
const blockNumberStub = '0x0'
beforeEach(function () {
- const txMeta2 = txMeta3 = txMeta
- txList = [txMeta, txMeta2, txMeta3].map((tx) => {
+ const txMeta2 = txMeta3 = txMeta
+ txList = [txMeta, txMeta2, txMeta3].map((tx) => {
tx.processed = new Promise((resolve) => { tx.resolve = resolve })
return tx
})
@@ -183,8 +183,8 @@ describe('PendingTransactionTracker', function () {
pendingTxTracker.getPendingTransactions = () => txList
pendingTxTracker._resubmitTx = async (tx) => { tx.resolve(tx) }
Promise.all(txList.map((tx) => tx.processed))
- .then(() => done())
- .catch(done)
+ .then(() => done())
+ .catch(done)
pendingTxTracker.resubmitPendingTxs(blockNumberStub)
})
it('should not emit \'tx:failed\' if the txMeta throws a known txError', function (done) {
@@ -209,8 +209,8 @@ describe('PendingTransactionTracker', function () {
throw new Error(knownErrors.pop())
}
Promise.all(txList.map((tx) => tx.processed))
- .then(() => done())
- .catch(done)
+ .then(() => done())
+ .catch(done)
pendingTxTracker.resubmitPendingTxs(blockNumberStub)
})
@@ -227,8 +227,8 @@ describe('PendingTransactionTracker', function () {
pendingTxTracker.getPendingTransactions = () => txList
pendingTxTracker._resubmitTx = async () => { throw new TypeError('im some real error') }
Promise.all(txList.map((tx) => tx.processed))
- .then(() => done())
- .catch(done)
+ .then(() => done())
+ .catch(done)
pendingTxTracker.resubmitPendingTxs(blockNumberStub)
})
@@ -264,11 +264,11 @@ describe('PendingTransactionTracker', function () {
// Stubbing out current account state:
// Adding the fake tx:
pendingTxTracker._resubmitTx(txMeta)
- .then(() => done())
- .catch((err) => {
- assert.ifError(err, 'should not throw an error')
- done(err)
- })
+ .then(() => done())
+ .catch((err) => {
+ assert.ifError(err, 'should not throw an error')
+ done(err)
+ })
assert.equal(pendingTxTracker.publishTransaction.callCount, 1, 'Should call publish transaction')
})
@@ -278,11 +278,11 @@ describe('PendingTransactionTracker', function () {
const mockLatestBlockNumber = '0x5'
pendingTxTracker._resubmitTx(txMetaToTestExponentialBackoff, mockLatestBlockNumber)
- .then(() => done())
- .catch((err) => {
- assert.ifError(err, 'should not throw an error')
- done(err)
- })
+ .then(() => done())
+ .catch((err) => {
+ assert.ifError(err, 'should not throw an error')
+ done(err)
+ })
assert.equal(pendingTxTracker.publishTransaction.callCount, 0, 'Should NOT call publish transaction')
})
@@ -292,11 +292,11 @@ describe('PendingTransactionTracker', function () {
const mockLatestBlockNumber = '0x11'
pendingTxTracker._resubmitTx(txMetaToTestExponentialBackoff, mockLatestBlockNumber)
- .then(() => done())
- .catch((err) => {
- assert.ifError(err, 'should not throw an error')
- done(err)
- })
+ .then(() => done())
+ .catch((err) => {
+ assert.ifError(err, 'should not throw an error')
+ done(err)
+ })
assert.equal(pendingTxTracker.publishTransaction.callCount, 1, 'Should call publish transaction')
})
@@ -382,11 +382,11 @@ describe('PendingTransactionTracker', function () {
value: '0xfffff',
},
})
- .then((taken) => {
- assert.ok(!taken)
- done()
- })
- .catch(done)
+ .then((taken) => {
+ assert.ok(!taken)
+ done()
+ })
+ .catch(done)
})
it('should return true if nonce has been taken', function (done) {
@@ -400,7 +400,7 @@ describe('PendingTransactionTracker', function () {
assert.ok(taken)
done()
})
- .catch(done)
+ .catch(done)
})
})
})
diff --git a/test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js b/test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js
index d3e47c67e..1d6a0eb08 100644
--- a/test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js
+++ b/test/unit/app/controllers/transactions/recipient-blacklist-checker-test.js
@@ -31,8 +31,8 @@ describe('Recipient Blacklist Checker', function () {
const networks = [ROPSTEN_CODE, RINKEYBY_CODE, KOVAN_CODE, GOERLI_CODE]
for (const networkId in networks) {
publicAccounts.forEach((account) => {
- recipientBlackListChecker.checkAccount(networkId, account)
- callCount++
+ recipientBlackListChecker.checkAccount(networkId, account)
+ callCount++
})
}
assert.equal(callCount, 40)
diff --git a/test/unit/app/controllers/transactions/tx-controller-test.js b/test/unit/app/controllers/transactions/tx-controller-test.js
index 8ff409207..9072dc684 100644
--- a/test/unit/app/controllers/transactions/tx-controller-test.js
+++ b/test/unit/app/controllers/transactions/tx-controller-test.js
@@ -129,13 +129,13 @@ describe('Transaction Controller', function () {
stub = sinon.stub(txController, 'addUnapprovedTransaction').callsFake(() => {
txController.emit('newUnapprovedTx', txMeta)
return Promise.resolve(txController.txStateManager.addTx(txMeta))
- })
+ })
- afterEach(function () {
- txController.txStateManager._saveTxList([])
- stub.restore()
+ afterEach(function () {
+ txController.txStateManager._saveTxList([])
+ stub.restore()
+ })
})
- })
it('should resolve when finished and status is submitted and resolve with the hash', function (done) {
txController.once('newUnapprovedTx', (txMetaFromEmit) => {
@@ -146,11 +146,11 @@ describe('Transaction Controller', function () {
})
txController.newUnapprovedTransaction(txParams)
- .then((hash) => {
- assert(hash, 'newUnapprovedTransaction needs to return the hash')
- done()
- })
- .catch(done)
+ .then((hash) => {
+ assert(hash, 'newUnapprovedTransaction needs to return the hash')
+ done()
+ })
+ .catch(done)
})
it('should reject when finished and status is rejected', function (done) {
@@ -161,10 +161,10 @@ describe('Transaction Controller', function () {
})
txController.newUnapprovedTransaction(txParams)
- .catch((err) => {
- if (err.message === 'MetaMask Tx Signature: User denied transaction signature.') done()
- else done(err)
- })
+ .catch((err) => {
+ if (err.message === 'MetaMask Tx Signature: User denied transaction signature.') done()
+ else done(err)
+ })
})
})
@@ -182,17 +182,17 @@ describe('Transaction Controller', function () {
it('should add an unapproved transaction and return a valid txMeta', function (done) {
txController.addUnapprovedTransaction({ from: selectedAddress })
- .then((txMeta) => {
- assert(('id' in txMeta), 'should have a id')
- assert(('time' in txMeta), 'should have a time stamp')
- assert(('metamaskNetworkId' in txMeta), 'should have a metamaskNetworkId')
- assert(('txParams' in txMeta), 'should have a txParams')
- assert(('history' in txMeta), 'should have a history')
-
- const memTxMeta = txController.txStateManager.getTx(txMeta.id)
- assert.deepEqual(txMeta, memTxMeta, `txMeta should be stored in txController after adding it\n expected: ${txMeta} \n got: ${memTxMeta}`)
- done()
- }).catch(done)
+ .then((txMeta) => {
+ assert(('id' in txMeta), 'should have a id')
+ assert(('time' in txMeta), 'should have a time stamp')
+ assert(('metamaskNetworkId' in txMeta), 'should have a metamaskNetworkId')
+ assert(('txParams' in txMeta), 'should have a txParams')
+ assert(('history' in txMeta), 'should have a history')
+
+ const memTxMeta = txController.txStateManager.getTx(txMeta.id)
+ assert.deepEqual(txMeta, memTxMeta, `txMeta should be stored in txController after adding it\n expected: ${txMeta} \n got: ${memTxMeta}`)
+ done()
+ }).catch(done)
})
it('should emit newUnapprovedTx event and pass txMeta as the first argument', function (done) {
@@ -202,16 +202,16 @@ describe('Transaction Controller', function () {
done()
})
txController.addUnapprovedTransaction({ from: selectedAddress })
- .catch(done)
+ .catch(done)
})
it('should fail if recipient is public', function (done) {
txController.networkStore = new ObservableStore(1)
txController.addUnapprovedTransaction({ from: selectedAddress, to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' })
- .catch((err) => {
- if (err.message === 'Recipient is a public account') done()
- else done(err)
- })
+ .catch((err) => {
+ if (err.message === 'Recipient is a public account') done()
+ else done(err)
+ })
})
it('should fail if the from address isn\'t the selected address', function (done) {
@@ -232,16 +232,16 @@ describe('Transaction Controller', function () {
done()
})
txController.addUnapprovedTransaction({ from: selectedAddress, to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' })
- .catch(done)
+ .catch(done)
})
it('should fail if netId is loading', function (done) {
txController.networkStore = new ObservableStore('loading')
txController.addUnapprovedTransaction({ from: selectedAddress, to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' })
- .catch((err) => {
- if (err.message === 'MetaMask is having trouble connecting to the network') done()
- else done(err)
- })
+ .catch((err) => {
+ if (err.message === 'MetaMask is having trouble connecting to the network') done()
+ else done(err)
+ })
})
})
@@ -284,11 +284,11 @@ describe('Transaction Controller', function () {
}))
})
Promise.all(listeners)
- .then((returnValues) => {
- assert.deepEqual(returnValues.pop(), txMeta, 'last event 1:unapproved should return txMeta')
- done()
- })
- .catch(done)
+ .then((returnValues) => {
+ assert.deepEqual(returnValues.pop(), txMeta, 'last event 1:unapproved should return txMeta')
+ done()
+ })
+ .catch(done)
txController.addTx(txMeta)
})
})
@@ -511,16 +511,16 @@ describe('Transaction Controller', function () {
{ id: 1, status: 'submitted', metamaskNetworkId: currentNetworkId, txParams, history: [{}] },
])
txController.retryTransaction(1)
- .then((txMeta) => {
- assert.equal(txMeta.txParams.gasPrice, '0x10642ac00', 'gasPrice should have a %10 gasPrice bump')
- assert.equal(txMeta.txParams.nonce, txParams.nonce, 'nonce should be the same')
- assert.equal(txMeta.txParams.from, txParams.from, 'from should be the same')
- assert.equal(txMeta.txParams.to, txParams.to, 'to should be the same')
- assert.equal(txMeta.txParams.data, txParams.data, 'data should be the same')
- assert.ok(('lastGasPrice' in txMeta), 'should have the key `lastGasPrice`')
- assert.equal(txController.txStateManager.getTxList().length, 2)
- done()
- }).catch(done)
+ .then((txMeta) => {
+ assert.equal(txMeta.txParams.gasPrice, '0x10642ac00', 'gasPrice should have a %10 gasPrice bump')
+ assert.equal(txMeta.txParams.nonce, txParams.nonce, 'nonce should be the same')
+ assert.equal(txMeta.txParams.from, txParams.from, 'from should be the same')
+ assert.equal(txMeta.txParams.to, txParams.to, 'to should be the same')
+ assert.equal(txMeta.txParams.data, txParams.data, 'data should be the same')
+ assert.ok(('lastGasPrice' in txMeta), 'should have the key `lastGasPrice`')
+ assert.equal(txController.txStateManager.getTxList().length, 2)
+ done()
+ }).catch(done)
})
})
diff --git a/test/unit/app/controllers/transactions/tx-state-manager-test.js b/test/unit/app/controllers/transactions/tx-state-manager-test.js
index 72dbbc4a1..48343bcd7 100644
--- a/test/unit/app/controllers/transactions/tx-state-manager-test.js
+++ b/test/unit/app/controllers/transactions/tx-state-manager-test.js
@@ -43,7 +43,7 @@ describe('TransactionStateManager', function () {
})
describe('#setTxStatusRejected', function () {
- it('sets the tx status to rejected and removes it from history', function () {
+ it('sets the tx status to rejected and removes it from history', function () {
const tx = { id: 1, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: {} }
txStateManager.addTx(tx)
txStateManager.setTxStatusRejected(1)
@@ -56,11 +56,11 @@ describe('TransactionStateManager', function () {
const tx = { id: 1, status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: {} }
txStateManager.addTx(tx)
const noop = function (err) {
- if (err) {
- console.log('Error: ', err)
- }
- assert(true, 'event listener has been triggered and noop executed')
- done()
+ if (err) {
+ console.log('Error: ', err)
+ }
+ assert(true, 'event listener has been triggered and noop executed')
+ done()
}
txStateManager.on('1:rejected', noop)
txStateManager.setTxStatusRejected(1)
diff --git a/test/unit/app/controllers/transactions/tx-utils-test.js b/test/unit/app/controllers/transactions/tx-utils-test.js
index 029fab4d5..65c8d35b0 100644
--- a/test/unit/app/controllers/transactions/tx-utils-test.js
+++ b/test/unit/app/controllers/transactions/tx-utils-test.js
@@ -93,6 +93,6 @@ describe('txUtils', function () {
// should run
txParams.from = '0x1678a085c290ebd122dc42cba69373b5953b831d'
txUtils.validateFrom(txParams)
- })
+ })
})
})
diff --git a/test/unit/app/edge-encryptor-test.js b/test/unit/app/edge-encryptor-test.js
index 52817cd09..ad873e351 100644
--- a/test/unit/app/edge-encryptor-test.js
+++ b/test/unit/app/edge-encryptor-test.js
@@ -65,13 +65,13 @@ describe('EdgeEncryptor', function () {
edgeEncryptor.encrypt(password, data)
.then(function (encryptedData) {
edgeEncryptor.decrypt(password, encryptedData)
- .then(function (decryptedData) {
- assert.equal(decryptedData, data)
- done()
- })
- .catch(function (err) {
- done(err)
- })
+ .then(function (decryptedData) {
+ assert.equal(decryptedData, data)
+ done()
+ })
+ .catch(function (err) {
+ done(err)
+ })
})
.catch(function (err) {
done(err)
@@ -83,15 +83,15 @@ describe('EdgeEncryptor', function () {
edgeEncryptor.encrypt(password, data)
.then(function (encryptedData) {
edgeEncryptor.decrypt('wrong password', encryptedData)
- .then(function () {
- assert.fail('could decrypt with wrong password')
- done()
- })
- .catch(function (err) {
- assert.ok(err instanceof Error)
- assert.equal(err.message, 'Incorrect password')
- done()
- })
+ .then(function () {
+ assert.fail('could decrypt with wrong password')
+ done()
+ })
+ .catch(function (err) {
+ assert.ok(err instanceof Error)
+ assert.equal(err.message, 'Incorrect password')
+ done()
+ })
})
.catch(function (err) {
done(err)
diff --git a/test/unit/localhostState.js b/test/unit/localhostState.js
index f9fa157d7..71adbb859 100644
--- a/test/unit/localhostState.js
+++ b/test/unit/localhostState.js
@@ -10,12 +10,12 @@
*/
const initialState = {
config: {},
- NetworkController: {
- provider: {
- type: 'rpc',
- rpcTarget: 'http://localhost:8545',
- },
+ NetworkController: {
+ provider: {
+ type: 'rpc',
+ rpcTarget: 'http://localhost:8545',
},
+ },
}
module.exports = initialState
diff --git a/test/unit/migrations/021-test.js b/test/unit/migrations/021-test.js
index 458e9b4b5..d46b2a835 100644
--- a/test/unit/migrations/021-test.js
+++ b/test/unit/migrations/021-test.js
@@ -6,11 +6,11 @@ const migration21 = require('../../../app/scripts/migrations/021')
describe('wallet2 is migrated successfully with out the BlacklistController', () => {
it('should delete BlacklistController key', (done) => {
migration21.migrate(wallet2)
- .then((migratedData) => {
- assert.equal(migratedData.meta.version, 21)
- assert(!migratedData.data.BlacklistController)
- assert(!migratedData.data.RecentBlocks)
- done()
- }).catch(done)
+ .then((migratedData) => {
+ assert.equal(migratedData.meta.version, 21)
+ assert(!migratedData.data.BlacklistController)
+ assert(!migratedData.data.RecentBlocks)
+ done()
+ }).catch(done)
})
})
diff --git a/test/unit/migrations/022-test.js b/test/unit/migrations/022-test.js
index f8ee00e38..f7dd35b08 100644
--- a/test/unit/migrations/022-test.js
+++ b/test/unit/migrations/022-test.js
@@ -17,16 +17,16 @@ const storage = {
describe('storage is migrated successfully where transactions that are submitted have submittedTimes', () => {
it('should add submittedTime key on the txMeta if appropriate', (done) => {
migration22.migrate(storage)
- .then((migratedData) => {
- const [txMeta1, txMeta2, txMeta3] = migratedData.data.TransactionController.transactions
- assert.equal(migratedData.meta.version, 22)
- // should have written a submitted time
- assert(txMeta1.submittedTime)
- // should not have written a submitted time because it already has one
- assert.equal(txMeta2.submittedTime, properTime)
- // should not have written a submitted time
- assert(!txMeta3.submittedTime)
- done()
- }).catch(done)
+ .then((migratedData) => {
+ const [txMeta1, txMeta2, txMeta3] = migratedData.data.TransactionController.transactions
+ assert.equal(migratedData.meta.version, 22)
+ // should have written a submitted time
+ assert(txMeta1.submittedTime)
+ // should not have written a submitted time because it already has one
+ assert.equal(txMeta2.submittedTime, properTime)
+ // should not have written a submitted time
+ assert(!txMeta3.submittedTime)
+ done()
+ }).catch(done)
})
})
diff --git a/test/unit/migrations/023-test.js b/test/unit/migrations/023-test.js
index 7da94448d..1b47dea92 100644
--- a/test/unit/migrations/023-test.js
+++ b/test/unit/migrations/023-test.js
@@ -57,41 +57,41 @@ storage.data.TransactionController.transactions = transactions
describe('storage is migrated successfully and the proper transactions are remove from state', () => {
it('should remove transactions that are unneeded', (done) => {
migration23.migrate(storage)
- .then((migratedData) => {
- let leftoverNonDeletableTxCount = 0
- const migratedTransactions = migratedData.data.TransactionController.transactions
- migratedTransactions.forEach((tx) => {
- if (!deletableTxStates.find((s) => s === tx.status)) {
- leftoverNonDeletableTxCount++
- }
- })
- assert.equal(leftoverNonDeletableTxCount, nonDeletableCount, 'migration shouldnt delete transactions we want to keep')
- assert((migratedTransactions.length >= 40), `should be equal or greater to 40 if they are non deletable states got ${migratedTransactions.length} transactions`)
- done()
- }).catch(done)
+ .then((migratedData) => {
+ let leftoverNonDeletableTxCount = 0
+ const migratedTransactions = migratedData.data.TransactionController.transactions
+ migratedTransactions.forEach((tx) => {
+ if (!deletableTxStates.find((s) => s === tx.status)) {
+ leftoverNonDeletableTxCount++
+ }
+ })
+ assert.equal(leftoverNonDeletableTxCount, nonDeletableCount, 'migration shouldnt delete transactions we want to keep')
+ assert((migratedTransactions.length >= 40), `should be equal or greater to 40 if they are non deletable states got ${migratedTransactions.length} transactions`)
+ done()
+ }).catch(done)
})
it('should not remove any transactions because 40 is the expectable limit', (done) => {
storage.meta.version = 22
storage.data.TransactionController.transactions = transactions40
migration23.migrate(storage)
- .then((migratedData) => {
- const migratedTransactions = migratedData.data.TransactionController.transactions
+ .then((migratedData) => {
+ const migratedTransactions = migratedData.data.TransactionController.transactions
- assert.equal(migratedTransactions.length, 40, 'migration shouldnt delete when at limit')
- done()
- }).catch(done)
+ assert.equal(migratedTransactions.length, 40, 'migration shouldnt delete when at limit')
+ done()
+ }).catch(done)
})
it('should not remove any transactions because 20 txs is under the expectable limit', (done) => {
storage.meta.version = 22
storage.data.TransactionController.transactions = transactions20
migration23.migrate(storage)
- .then((migratedData) => {
- const migratedTransactions = migratedData.data.TransactionController.transactions
- assert.equal(migratedTransactions.length, 20, 'migration shouldnt delete when under limit')
- done()
- }).catch(done)
+ .then((migratedData) => {
+ const migratedTransactions = migratedData.data.TransactionController.transactions
+ assert.equal(migratedTransactions.length, 20, 'migration shouldnt delete when under limit')
+ done()
+ }).catch(done)
})
})
diff --git a/test/unit/migrations/024-test.js b/test/unit/migrations/024-test.js
index c7b0611bc..671c7f832 100644
--- a/test/unit/migrations/024-test.js
+++ b/test/unit/migrations/024-test.js
@@ -28,21 +28,21 @@ storage.data.TransactionController.transactions = transactions
describe('storage is migrated successfully and the txParams.from are lowercase', () => {
it('should lowercase the from for unapproved txs', (done) => {
migration24.migrate(storage)
- .then((migratedData) => {
- const migratedTransactions = migratedData.data.TransactionController.transactions
- migratedTransactions.forEach((tx) => {
- if (tx.status === 'unapproved') assert.equal(tx.txParams.from, '0x8acce2391c0d510a6c5e5d8f819a678f79b7e675')
- else assert.equal(tx.txParams.from, '0x8aCce2391c0d510a6c5E5d8f819a678f79b7e675')
- })
- done()
- }).catch(done)
+ .then((migratedData) => {
+ const migratedTransactions = migratedData.data.TransactionController.transactions
+ migratedTransactions.forEach((tx) => {
+ if (tx.status === 'unapproved') assert.equal(tx.txParams.from, '0x8acce2391c0d510a6c5e5d8f819a678f79b7e675')
+ else assert.equal(tx.txParams.from, '0x8aCce2391c0d510a6c5E5d8f819a678f79b7e675')
+ })
+ done()
+ }).catch(done)
})
it('should migrate first time state', (done) => {
migration24.migrate(firstTimeState)
- .then((migratedData) => {
- assert.equal(migratedData.meta.version, 24)
- done()
- }).catch(done)
+ .then((migratedData) => {
+ assert.equal(migratedData.meta.version, 24)
+ done()
+ }).catch(done)
})
})
diff --git a/test/unit/migrations/025-test.js b/test/unit/migrations/025-test.js
index 1e56913a1..fa89bc54f 100644
--- a/test/unit/migrations/025-test.js
+++ b/test/unit/migrations/025-test.js
@@ -29,21 +29,21 @@ storage.data.TransactionController.transactions = transactions
describe('storage is migrated successfully and the txParams.from are lowercase', () => {
it('should lowercase the from for unapproved txs', (done) => {
migration25.migrate(storage)
- .then((migratedData) => {
- const migratedTransactions = migratedData.data.TransactionController.transactions
- migratedTransactions.forEach((tx) => {
- if (tx.status === 'unapproved') assert(!tx.txParams.random)
- if (tx.status === 'unapproved') assert(!tx.txParams.chainId)
- })
- done()
- }).catch(done)
+ .then((migratedData) => {
+ const migratedTransactions = migratedData.data.TransactionController.transactions
+ migratedTransactions.forEach((tx) => {
+ if (tx.status === 'unapproved') assert(!tx.txParams.random)
+ if (tx.status === 'unapproved') assert(!tx.txParams.chainId)
+ })
+ done()
+ }).catch(done)
})
it('should migrate first time state', (done) => {
migration25.migrate(firstTimeState)
- .then((migratedData) => {
- assert.equal(migratedData.meta.version, 25)
- done()
- }).catch(done)
+ .then((migratedData) => {
+ assert.equal(migratedData.meta.version, 25)
+ done()
+ }).catch(done)
})
})
diff --git a/test/unit/migrations/029-test.js b/test/unit/migrations/029-test.js
index a2876487b..7f9b8a005 100644
--- a/test/unit/migrations/029-test.js
+++ b/test/unit/migrations/029-test.js
@@ -19,20 +19,20 @@ const storage = {
describe('storage is migrated successfully where transactions that are submitted have submittedTimes', () => {
it('should auto fail transactions more than 12 hours old', (done) => {
migration29.migrate(storage)
- .then((migratedData) => {
- const txs = migratedData.data.TransactionController.transactions
- const [ txMeta1 ] = txs
- assert.equal(migratedData.meta.version, 29)
+ .then((migratedData) => {
+ const txs = migratedData.data.TransactionController.transactions
+ const [ txMeta1 ] = txs
+ assert.equal(migratedData.meta.version, 29)
- assert.equal(txMeta1.status, 'failed', 'old tx is auto failed')
- assert(txMeta1.err.message.includes('too long'), 'error message assigned')
+ assert.equal(txMeta1.status, 'failed', 'old tx is auto failed')
+ assert(txMeta1.err.message.includes('too long'), 'error message assigned')
- txs.forEach((tx) => {
- if (tx.id === 1) return
- assert.notEqual(tx.status, 'failed', 'other tx is not auto failed')
- })
+ txs.forEach((tx) => {
+ if (tx.id === 1) return
+ assert.notEqual(tx.status, 'failed', 'other tx is not auto failed')
+ })
- done()
- }).catch(done)
+ done()
+ }).catch(done)
})
})
diff --git a/test/unit/migrations/030-test.js b/test/unit/migrations/030-test.js
index ca410342f..a8e7b4b32 100644
--- a/test/unit/migrations/030-test.js
+++ b/test/unit/migrations/030-test.js
@@ -25,13 +25,13 @@ const storage = {
describe('storage is migrated successfully', () => {
it('should work', (done) => {
migrationTemplate.migrate(storage)
- .then((migratedData) => {
- assert.equal(migratedData.meta.version, 30)
- assert.equal(migratedData.data.PreferencesController.frequentRpcListDetail[0].chainId, undefined)
- assert.equal(migratedData.data.PreferencesController.frequentRpcListDetail[1].chainId, '1')
- assert.equal(migratedData.data.NetworkController.provider.chainId, undefined)
- assert.equal(migratedData.data.NetworkController.network, undefined)
- done()
- }).catch(done)
+ .then((migratedData) => {
+ assert.equal(migratedData.meta.version, 30)
+ assert.equal(migratedData.data.PreferencesController.frequentRpcListDetail[0].chainId, undefined)
+ assert.equal(migratedData.data.PreferencesController.frequentRpcListDetail[1].chainId, '1')
+ assert.equal(migratedData.data.NetworkController.provider.chainId, undefined)
+ assert.equal(migratedData.data.NetworkController.network, undefined)
+ done()
+ }).catch(done)
})
})
diff --git a/test/unit/migrations/031-test.js b/test/unit/migrations/031-test.js
index c85fd7af4..4fcd8b9a5 100644
--- a/test/unit/migrations/031-test.js
+++ b/test/unit/migrations/031-test.js
@@ -1,7 +1,7 @@
const assert = require('assert')
const migration31 = require('../../../app/scripts/migrations/031')
- describe('migration #31', () => {
+describe('migration #31', () => {
it('should set completedOnboarding to true if vault exists', done => {
const oldStorage = {
'meta': {},
@@ -23,7 +23,7 @@ const migration31 = require('../../../app/scripts/migrations/031')
},
}
- migration31.migrate(oldStorage)
+ migration31.migrate(oldStorage)
.then(newStorage => {
assert.equal(newStorage.data.PreferencesController.completedOnboarding, true)
done()
@@ -31,7 +31,7 @@ const migration31 = require('../../../app/scripts/migrations/031')
.catch(done)
})
- it('should set completedOnboarding to false if vault does not exist', done => {
+ it('should set completedOnboarding to false if vault does not exist', done => {
const oldStorage = {
'meta': {},
'data': {
@@ -46,7 +46,7 @@ const migration31 = require('../../../app/scripts/migrations/031')
},
}
- migration31.migrate(oldStorage)
+ migration31.migrate(oldStorage)
.then(newStorage => {
assert.equal(newStorage.data.PreferencesController.completedOnboarding, false)
done()
diff --git a/test/unit/migrations/migrations-test.js b/test/unit/migrations/migrations-test.js
index 50afd9c2e..563b02a6d 100644
--- a/test/unit/migrations/migrations-test.js
+++ b/test/unit/migrations/migrations-test.js
@@ -27,82 +27,82 @@ describe('wallet1 is migrated successfully', () => {
wallet1.data.config.provider = { type: 'etherscan', rpcTarget: null }
return migration2.migrate(wallet1)
- .then((secondResult) => {
- const secondData = secondResult.data
- assert.equal(secondData.config.provider.type, 'rpc', 'provider should be rpc')
- assert.equal(secondData.config.provider.rpcTarget, 'https://rpc.metamask.io/', 'main provider should be our rpc')
- secondResult.data.config.provider.rpcTarget = oldTestRpc
- return migration3.migrate(secondResult)
- }).then((thirdResult) => {
- assert.equal(thirdResult.data.config.provider.rpcTarget, newTestRpc, 'config.provider.rpcTarget should be set to the proper testrpc url.')
- return migration4.migrate(thirdResult)
- }).then((fourthResult) => {
- const fourthData = fourthResult.data
- assert.equal(fourthData.config.provider.rpcTarget, null, 'old rpcTarget should not exist.')
- assert.equal(fourthData.config.provider.type, 'testnet', 'config.provider should be set to testnet.')
-
- return migration5.migrate(vault4)
- }).then((fifthResult) => {
- const fifthData = fifthResult.data
- assert.equal(fifthData.vault, null, 'old vault should not exist')
- assert.equal(fifthData.walletNicknames, null, 'old walletNicknames should not exist')
- assert.equal(fifthData.config.selectedAccount, null, 'old config.selectedAccount should not exist')
- assert.equal(fifthData.KeyringController.vault, vault4.data.vault, 'KeyringController.vault should exist')
- assert.equal(fifthData.KeyringController.selectedAccount, vault4.data.config.selectedAccount, 'KeyringController.selectedAccount should have moved')
- assert.equal(fifthData.KeyringController.walletNicknames['0x0beb674745816b125fbc07285d39fd373e64895c'], vault4.data.walletNicknames['0x0beb674745816b125fbc07285d39fd373e64895c'], 'KeyringController.walletNicknames should have moved')
-
- vault5 = fifthResult
- return migration6.migrate(fifthResult)
- }).then((sixthResult) => {
- assert.equal(sixthResult.data.KeyringController.selectedAccount, null, 'old selectedAccount should not exist')
- assert.equal(sixthResult.data.PreferencesController.selectedAddress, vault5.data.KeyringController.selectedAccount, 'selectedAccount should have moved')
-
- vault6 = sixthResult
- return migration7.migrate(sixthResult)
- }).then((seventhResult) => {
- assert.equal(seventhResult.data.transactions, null, 'old transactions should not exist')
- assert.equal(seventhResult.data.gasMultiplier, null, 'old gasMultiplier should not exist')
- assert.equal(seventhResult.data.TransactionManager.transactions[0].id, vault6.data.transactions[0].id, 'transactions should have moved')
- assert.equal(seventhResult.data.TransactionManager.gasMultiplier, vault6.data.gasMultiplier, 'gasMultiplier should have moved')
-
- vault7 = seventhResult
- return migration8.migrate(seventhResult)
- }).then((eighthResult) => {
- assert.equal(eighthResult.data.noticesList, null, 'old noticesList should not exist')
- assert.equal(eighthResult.data.NoticeController.noticesList[0].title, vault7.data.noticesList[0].title, 'noticesList should have moved')
-
- vault8 = eighthResult
- return migration9.migrate(eighthResult)
- }).then((ninthResult) => {
- assert.equal(ninthResult.data.currentFiat, null, 'old currentFiat should not exist')
- assert.equal(ninthResult.data.fiatCurrency, null, 'old fiatCurrency should not exist')
- assert.equal(ninthResult.data.conversionRate, null, 'old conversionRate should not exist')
- assert.equal(ninthResult.data.conversionDate, null, 'old conversionDate should not exist')
-
- assert.equal(ninthResult.data.CurrencyController.currentCurrency, vault8.data.fiatCurrency, 'currentFiat should have moved')
- assert.equal(ninthResult.data.CurrencyController.conversionRate, vault8.data.conversionRate, 'conversionRate should have moved')
- assert.equal(ninthResult.data.CurrencyController.conversionDate, vault8.data.conversionDate, 'conversionDate should have moved')
-
- vault9 = ninthResult
- return migration10.migrate(ninthResult)
- }).then((tenthResult) => {
- assert.equal(tenthResult.data.shapeShiftTxList, null, 'old shapeShiftTxList should not exist')
- assert.equal(tenthResult.data.ShapeShiftController.shapeShiftTxList[0].transaction, vault9.data.shapeShiftTxList[0].transaction)
-
- return migration11.migrate(tenthResult)
- }).then((eleventhResult) => {
- assert.equal(eleventhResult.data.isDisclaimerConfirmed, null, 'isDisclaimerConfirmed should not exist')
- assert.equal(eleventhResult.data.TOSHash, null, 'TOSHash should not exist')
-
- return migration12.migrate(eleventhResult)
- }).then((twelfthResult) => {
- assert.equal(twelfthResult.data.NoticeController.noticesList[0].body, '', 'notices that have been read should have an empty body.')
- assert.equal(twelfthResult.data.NoticeController.noticesList[1].body, 'nonempty', 'notices that have not been read should not have an empty body.')
-
- assert.equal(twelfthResult.data.config.provider.type, 'testnet', 'network is originally testnet.')
- return migration13.migrate(twelfthResult)
- }).then((thirteenthResult) => {
- assert.equal(thirteenthResult.data.config.provider.type, 'ropsten', 'network has been changed to ropsten.')
- })
+ .then((secondResult) => {
+ const secondData = secondResult.data
+ assert.equal(secondData.config.provider.type, 'rpc', 'provider should be rpc')
+ assert.equal(secondData.config.provider.rpcTarget, 'https://rpc.metamask.io/', 'main provider should be our rpc')
+ secondResult.data.config.provider.rpcTarget = oldTestRpc
+ return migration3.migrate(secondResult)
+ }).then((thirdResult) => {
+ assert.equal(thirdResult.data.config.provider.rpcTarget, newTestRpc, 'config.provider.rpcTarget should be set to the proper testrpc url.')
+ return migration4.migrate(thirdResult)
+ }).then((fourthResult) => {
+ const fourthData = fourthResult.data
+ assert.equal(fourthData.config.provider.rpcTarget, null, 'old rpcTarget should not exist.')
+ assert.equal(fourthData.config.provider.type, 'testnet', 'config.provider should be set to testnet.')
+
+ return migration5.migrate(vault4)
+ }).then((fifthResult) => {
+ const fifthData = fifthResult.data
+ assert.equal(fifthData.vault, null, 'old vault should not exist')
+ assert.equal(fifthData.walletNicknames, null, 'old walletNicknames should not exist')
+ assert.equal(fifthData.config.selectedAccount, null, 'old config.selectedAccount should not exist')
+ assert.equal(fifthData.KeyringController.vault, vault4.data.vault, 'KeyringController.vault should exist')
+ assert.equal(fifthData.KeyringController.selectedAccount, vault4.data.config.selectedAccount, 'KeyringController.selectedAccount should have moved')
+ assert.equal(fifthData.KeyringController.walletNicknames['0x0beb674745816b125fbc07285d39fd373e64895c'], vault4.data.walletNicknames['0x0beb674745816b125fbc07285d39fd373e64895c'], 'KeyringController.walletNicknames should have moved')
+
+ vault5 = fifthResult
+ return migration6.migrate(fifthResult)
+ }).then((sixthResult) => {
+ assert.equal(sixthResult.data.KeyringController.selectedAccount, null, 'old selectedAccount should not exist')
+ assert.equal(sixthResult.data.PreferencesController.selectedAddress, vault5.data.KeyringController.selectedAccount, 'selectedAccount should have moved')
+
+ vault6 = sixthResult
+ return migration7.migrate(sixthResult)
+ }).then((seventhResult) => {
+ assert.equal(seventhResult.data.transactions, null, 'old transactions should not exist')
+ assert.equal(seventhResult.data.gasMultiplier, null, 'old gasMultiplier should not exist')
+ assert.equal(seventhResult.data.TransactionManager.transactions[0].id, vault6.data.transactions[0].id, 'transactions should have moved')
+ assert.equal(seventhResult.data.TransactionManager.gasMultiplier, vault6.data.gasMultiplier, 'gasMultiplier should have moved')
+
+ vault7 = seventhResult
+ return migration8.migrate(seventhResult)
+ }).then((eighthResult) => {
+ assert.equal(eighthResult.data.noticesList, null, 'old noticesList should not exist')
+ assert.equal(eighthResult.data.NoticeController.noticesList[0].title, vault7.data.noticesList[0].title, 'noticesList should have moved')
+
+ vault8 = eighthResult
+ return migration9.migrate(eighthResult)
+ }).then((ninthResult) => {
+ assert.equal(ninthResult.data.currentFiat, null, 'old currentFiat should not exist')
+ assert.equal(ninthResult.data.fiatCurrency, null, 'old fiatCurrency should not exist')
+ assert.equal(ninthResult.data.conversionRate, null, 'old conversionRate should not exist')
+ assert.equal(ninthResult.data.conversionDate, null, 'old conversionDate should not exist')
+
+ assert.equal(ninthResult.data.CurrencyController.currentCurrency, vault8.data.fiatCurrency, 'currentFiat should have moved')
+ assert.equal(ninthResult.data.CurrencyController.conversionRate, vault8.data.conversionRate, 'conversionRate should have moved')
+ assert.equal(ninthResult.data.CurrencyController.conversionDate, vault8.data.conversionDate, 'conversionDate should have moved')
+
+ vault9 = ninthResult
+ return migration10.migrate(ninthResult)
+ }).then((tenthResult) => {
+ assert.equal(tenthResult.data.shapeShiftTxList, null, 'old shapeShiftTxList should not exist')
+ assert.equal(tenthResult.data.ShapeShiftController.shapeShiftTxList[0].transaction, vault9.data.shapeShiftTxList[0].transaction)
+
+ return migration11.migrate(tenthResult)
+ }).then((eleventhResult) => {
+ assert.equal(eleventhResult.data.isDisclaimerConfirmed, null, 'isDisclaimerConfirmed should not exist')
+ assert.equal(eleventhResult.data.TOSHash, null, 'TOSHash should not exist')
+
+ return migration12.migrate(eleventhResult)
+ }).then((twelfthResult) => {
+ assert.equal(twelfthResult.data.NoticeController.noticesList[0].body, '', 'notices that have been read should have an empty body.')
+ assert.equal(twelfthResult.data.NoticeController.noticesList[1].body, 'nonempty', 'notices that have not been read should not have an empty body.')
+
+ assert.equal(twelfthResult.data.config.provider.type, 'testnet', 'network is originally testnet.')
+ return migration13.migrate(twelfthResult)
+ }).then((thirteenthResult) => {
+ assert.equal(thirteenthResult.data.config.provider.type, 'ropsten', 'network has been changed to ropsten.')
+ })
})
})
diff --git a/test/unit/migrations/migrator-test.js b/test/unit/migrations/migrator-test.js
index 693c5830d..3dcc5aff7 100644
--- a/test/unit/migrations/migrator-test.js
+++ b/test/unit/migrations/migrator-test.js
@@ -40,20 +40,20 @@ describe('Migrator', () => {
const migrator = new Migrator({ migrations: stubMigrations })
it('migratedData version should be version 3', (done) => {
migrator.migrateData(versionedData)
- .then((migratedData) => {
- assert.equal(migratedData.meta.version, stubMigrations[2].version)
- done()
- }).catch(done)
+ .then((migratedData) => {
+ assert.equal(migratedData.meta.version, stubMigrations[2].version)
+ done()
+ }).catch(done)
})
it('should match the last version in live migrations', (done) => {
const migrator = new Migrator({ migrations: liveMigrations })
migrator.migrateData(firstTimeState)
- .then((migratedData) => {
- const last = liveMigrations.length - 1
- assert.equal(migratedData.meta.version, liveMigrations[last].version)
- done()
- }).catch(done)
+ .then((migratedData) => {
+ const last = liveMigrations.length - 1
+ assert.equal(migratedData.meta.version, liveMigrations[last].version)
+ done()
+ }).catch(done)
})
it('should emit an error', function (done) {
@@ -61,8 +61,8 @@ describe('Migrator', () => {
const migrator = new Migrator({ migrations: [{ version: 1, migrate: async () => { throw new Error('test') } } ] })
migrator.on('error', () => done())
migrator.migrateData({ meta: {version: 0} })
- .then(() => {
- }).catch(done)
+ .then(() => {
+ }).catch(done)
})
})
diff --git a/test/unit/migrations/template-test.js b/test/unit/migrations/template-test.js
index 0db69d65a..f606cce6f 100644
--- a/test/unit/migrations/template-test.js
+++ b/test/unit/migrations/template-test.js
@@ -8,9 +8,9 @@ const storage = {
describe('storage is migrated successfully', () => {
it('should work', (done) => {
migrationTemplate.migrate(storage)
- .then((migratedData) => {
- assert.equal(migratedData.meta.version, 0)
- done()
- }).catch(done)
+ .then((migratedData) => {
+ assert.equal(migratedData.meta.version, 0)
+ done()
+ }).catch(done)
})
})
diff --git a/test/unit/ui/app/actions.spec.js b/test/unit/ui/app/actions.spec.js
index 919bd81a6..5bf82a185 100644
--- a/test/unit/ui/app/actions.spec.js
+++ b/test/unit/ui/app/actions.spec.js
@@ -628,7 +628,7 @@ describe('Actions', () => {
{ type: 'DISPLAY_WARNING', value: 'error' },
{ type: 'HIDE_LOADING_INDICATION' },
{ type: 'LOCK_METAMASK' },
- ]
+ ]
backgroundSetLockedSpy = sinon.stub(background, 'setLocked')
backgroundSetLockedSpy.callsFake(callback => {
callback(new Error('error'))