aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ui/app/reducers
diff options
context:
space:
mode:
authorDan Finlay <542863+danfinlay@users.noreply.github.com>2019-08-07 05:53:50 +0800
committerGitHub <noreply@github.com>2019-08-07 05:53:50 +0800
commitdb08881d4527e8a037f401ef22b849e52152864f (patch)
tree6032d7a4ae67371889eece1d8490c26d5a119dd5 /test/unit/ui/app/reducers
parent4139019d0f4dd83f56da400ca7e0e6d1976d1716 (diff)
parent86ad9564a064fd6158dab6a3c9e5b10614ef6e68 (diff)
downloadtangerine-wallet-browser-7.0.0.tar
tangerine-wallet-browser-7.0.0.tar.gz
tangerine-wallet-browser-7.0.0.tar.bz2
tangerine-wallet-browser-7.0.0.tar.lz
tangerine-wallet-browser-7.0.0.tar.xz
tangerine-wallet-browser-7.0.0.tar.zst
tangerine-wallet-browser-7.0.0.zip
Merge pull request #6969 from MetaMask/developv7.0.0
Master Version Bump
Diffstat (limited to 'test/unit/ui/app/reducers')
-rw-r--r--test/unit/ui/app/reducers/app.spec.js15
-rw-r--r--test/unit/ui/app/reducers/metamask.spec.js58
2 files changed, 23 insertions, 50 deletions
diff --git a/test/unit/ui/app/reducers/app.spec.js b/test/unit/ui/app/reducers/app.spec.js
index 09cf3dbf0..6f8dd920c 100644
--- a/test/unit/ui/app/reducers/app.spec.js
+++ b/test/unit/ui/app/reducers/app.spec.js
@@ -270,18 +270,6 @@ describe('App State', () => {
assert.equal(state.isLoading, true)
})
- it('shows new vault seed', () => {
- const state = reduceApp(metamaskState, {
- type: actions.SHOW_NEW_VAULT_SEED,
- value: 'test seed words',
- })
-
- assert.equal(state.currentView.name, 'createVaultComplete')
- assert.equal(state.currentView.seedWords, 'test seed words')
- assert.equal(state.transForward, true)
- assert.equal(state.isLoading, false)
- })
-
it('shows new account screen', () => {
const state = reduceApp(metamaskState, {
type: actions.NEW_ACCOUNT_SCREEN,
@@ -437,7 +425,6 @@ describe('App State', () => {
})
assert.equal(state.currentView.name, 'accounts')
- assert.equal(state.currentView.seedWords, undefined)
assert.equal(state.transForward, true)
assert.equal(state.isLoading, false)
assert.equal(state.warning, null)
@@ -700,7 +687,7 @@ describe('App State', () => {
})
it('hides sub loading indicator', () => {
- const oldState = {...metamaskState, ...oldState}
+ const oldState = {...metamaskState, isSubLoading: true }
const state = reduceApp(oldState, {
type: actions.HIDE_SUB_LOADING_INDICATION,
})
diff --git a/test/unit/ui/app/reducers/metamask.spec.js b/test/unit/ui/app/reducers/metamask.spec.js
index d7876bf39..714bd476a 100644
--- a/test/unit/ui/app/reducers/metamask.spec.js
+++ b/test/unit/ui/app/reducers/metamask.spec.js
@@ -9,32 +9,6 @@ describe('MetaMask Reducers', () => {
assert(initState)
})
- it('sets revealing seed to true and adds seed words to new state', () => {
- const seedWordsState = reduceMetamask({}, {
- type: actions.SHOW_NEW_VAULT_SEED,
- value: 'test seed words',
- })
-
- assert.equal(seedWordsState.seedWords, 'test seed words')
- assert.equal(seedWordsState.isRevealingSeedWords, true)
- })
-
- it('shows account page', () => {
- const seedWordsState = {
- metamask: {
- seedwords: 'test seed words',
- isRevealing: true,
- },
- }
-
- const state = reduceMetamask(seedWordsState, {
- type: actions.SHOW_ACCOUNTS_PAGE,
- })
-
- assert.equal(state.seedWords, undefined)
- assert.equal(state.isRevealingSeedWords, false)
- })
-
it('unlocks MetaMask', () => {
const state = reduceMetamask({}, {
type: actions.UNLOCK_METAMASK,
@@ -152,16 +126,6 @@ describe('MetaMask Reducers', () => {
})
})
- it('shows new vault seed words and sets isRevealingSeedWords to true', () => {
- const showNewVaultSeedState = reduceMetamask({}, {
- type: actions.SHOW_NEW_VAULT_SEED,
- value: 'test seed words',
- })
-
- assert.equal(showNewVaultSeedState.isRevealingSeedWords, true)
- assert.equal(showNewVaultSeedState.seedWords, 'test seed words')
- })
-
it('shows account detail', () => {
const state = reduceMetamask({}, {
@@ -345,6 +309,8 @@ describe('MetaMask Reducers', () => {
errors: {},
editingTransactionId: 22,
forceGasMin: '0xGas',
+ ensResolution: null,
+ ensResolutionError: '',
}
const sendState = reduceMetamask({}, {
@@ -528,4 +494,24 @@ describe('MetaMask Reducers', () => {
assert.deepEqual(state.pendingTokens, {})
})
+
+ it('update ensResolution', () => {
+ const state = reduceMetamask({}, {
+ type: actions.UPDATE_SEND_ENS_RESOLUTION,
+ payload: '0x1337',
+ })
+
+ assert.deepEqual(state.send.ensResolution, '0x1337')
+ assert.deepEqual(state.send.ensResolutionError, '')
+ })
+
+ it('update ensResolutionError', () => {
+ const state = reduceMetamask({}, {
+ type: actions.UPDATE_SEND_ENS_RESOLUTION_ERROR,
+ payload: 'ens name not found',
+ })
+
+ assert.deepEqual(state.send.ensResolutionError, 'ens name not found')
+ assert.deepEqual(state.send.ensResolution, null)
+ })
})