aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-01-12 11:04:19 +0800
committerkumavis <aaron@kumavis.me>2017-01-12 11:31:21 +0800
commit8012ede12698477692b80769781096b559159a32 (patch)
tree17f75325da8f5d0abf2c1f37fa0573320730b6a7 /test
parentcc5e9aca4fa2a1e78c49be680405d93ac918bccf (diff)
downloadtangerine-wallet-browser-8012ede12698477692b80769781096b559159a32.tar
tangerine-wallet-browser-8012ede12698477692b80769781096b559159a32.tar.gz
tangerine-wallet-browser-8012ede12698477692b80769781096b559159a32.tar.bz2
tangerine-wallet-browser-8012ede12698477692b80769781096b559159a32.tar.lz
tangerine-wallet-browser-8012ede12698477692b80769781096b559159a32.tar.xz
tangerine-wallet-browser-8012ede12698477692b80769781096b559159a32.tar.zst
tangerine-wallet-browser-8012ede12698477692b80769781096b559159a32.zip
background - introduce ObservableStore
Diffstat (limited to 'test')
-rw-r--r--test/integration/lib/idStore-migrator-test.js33
1 files changed, 15 insertions, 18 deletions
diff --git a/test/integration/lib/idStore-migrator-test.js b/test/integration/lib/idStore-migrator-test.js
index 4ae30411d..1ceaac442 100644
--- a/test/integration/lib/idStore-migrator-test.js
+++ b/test/integration/lib/idStore-migrator-test.js
@@ -1,25 +1,23 @@
-var ConfigManager = require('../../../app/scripts/lib/config-manager')
-var IdStoreMigrator = require('../../../app/scripts/lib/idStore-migrator')
-var SimpleKeyring = require('../../../app/scripts/keyrings/simple')
-var normalize = require('../../../app/scripts/lib/sig-util').normalize
+const ObservableStore = require('../../../app/scripts/lib/observable/')
+const ConfigManager = require('../../../app/scripts/lib/config-manager')
+const IdStoreMigrator = require('../../../app/scripts/lib/idStore-migrator')
+const SimpleKeyring = require('../../../app/scripts/keyrings/simple')
+const normalize = require('../../../app/scripts/lib/sig-util').normalize
-var oldStyleVault = require('../mocks/oldVault.json')
-var badStyleVault = require('../mocks/badVault.json')
+const oldStyleVault = require('../mocks/oldVault.json')
+const badStyleVault = require('../mocks/badVault.json')
-var STORAGE_KEY = 'metamask-config'
-var PASSWORD = '12345678'
-var FIRST_ADDRESS = '0x4dd5d356c5A016A220bCD69e82e5AF680a430d00'.toLowerCase()
-var SEED = 'fringe damage bounce extend tunnel afraid alert sound all soldier all dinner'
-
-var BAD_STYLE_FIRST_ADDRESS = '0xac39b311dceb2a4b2f5d8461c1cdaf756f4f7ae9'
+const PASSWORD = '12345678'
+const FIRST_ADDRESS = '0x4dd5d356c5A016A220bCD69e82e5AF680a430d00'.toLowerCase()
+const BAD_STYLE_FIRST_ADDRESS = '0xac39b311dceb2a4b2f5d8461c1cdaf756f4f7ae9'
+const SEED = 'fringe damage bounce extend tunnel afraid alert sound all soldier all dinner'
QUnit.module('Old Style Vaults', {
beforeEach: function () {
- window.localStorage[STORAGE_KEY] = JSON.stringify(oldStyleVault)
+ let store = new ObservableStore(oldStyleVault)
this.configManager = new ConfigManager({
- loadData: () => { return JSON.parse(window.localStorage[STORAGE_KEY]) },
- setData: (data) => { window.localStorage[STORAGE_KEY] = JSON.stringify(data) },
+ store: store,
})
this.migrator = new IdStoreMigrator({
@@ -46,11 +44,10 @@ QUnit.test('migrator:migratedVaultForPassword', function (assert) {
QUnit.module('Old Style Vaults with bad HD seed', {
beforeEach: function () {
- window.localStorage[STORAGE_KEY] = JSON.stringify(badStyleVault)
+ let store = new ObservableStore(badStyleVault)
this.configManager = new ConfigManager({
- loadData: () => { return JSON.parse(window.localStorage[STORAGE_KEY]) },
- setData: (data) => { window.localStorage[STORAGE_KEY] = JSON.stringify(data) },
+ store: store,
})
this.migrator = new IdStoreMigrator({