aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ui
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2019-04-02 09:03:54 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-04-02 09:03:54 +0800
commita46ec83c9b258a3aed65e1ef08769300c01ca13b (patch)
treea48f7ddb8635ffbb024ff755d1865686c8a0ab27 /test/unit/ui
parent4055dc3475cb743e540766a8a8c704bb2b807502 (diff)
downloadtangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.gz
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.bz2
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.lz
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.xz
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.tar.zst
tangerine-wallet-browser-a46ec83c9b258a3aed65e1ef08769300c01ca13b.zip
Remove NoticeController (#6382)
Diffstat (limited to 'test/unit/ui')
-rw-r--r--test/unit/ui/app/actions.spec.js54
-rw-r--r--test/unit/ui/app/reducers/app.spec.js9
-rw-r--r--test/unit/ui/app/reducers/metamask.spec.js43
3 files changed, 2 insertions, 104 deletions
diff --git a/test/unit/ui/app/actions.spec.js b/test/unit/ui/app/actions.spec.js
index a578ec89c..86c3f8aff 100644
--- a/test/unit/ui/app/actions.spec.js
+++ b/test/unit/ui/app/actions.spec.js
@@ -1031,52 +1031,6 @@ describe('Actions', () => {
})
})
- describe('#markNoticeRead', () => {
- let markNoticeReadSpy
- const notice = {
- id: 0,
- read: false,
- date: 'test date',
- title: 'test title',
- body: 'test body',
- }
-
- beforeEach(() => {
- markNoticeReadSpy = sinon.stub(background, 'markNoticeRead')
- })
-
- afterEach(() => {
- markNoticeReadSpy.restore()
- })
-
- it('calls markNoticeRead in background', () => {
- const store = mockStore()
-
- store.dispatch(actions.markNoticeRead(notice))
- .then(() => {
- assert(markNoticeReadSpy.calledOnce)
- })
-
- })
-
- it('errors when markNoticeRead in background throws', () => {
- const store = mockStore()
- const expectedActions = [
- { type: 'SHOW_LOADING_INDICATION', value: undefined },
- { type: 'HIDE_LOADING_INDICATION' },
- { type: 'DISPLAY_WARNING', value: 'error' },
- ]
- markNoticeReadSpy.callsFake((notice, callback) => {
- callback(new Error('error'))
- })
-
- store.dispatch(actions.markNoticeRead())
- .catch(() => {
- assert.deepEqual(store.getActions(), expectedActions)
- })
- })
- })
-
describe('#setProviderType', () => {
let setProviderTypeSpy
let store
@@ -1309,24 +1263,20 @@ describe('Actions', () => {
})
describe('#setCompletedOnboarding', () => {
- let markAllNoticesReadSpy, completeOnboardingSpy
+ let completeOnboardingSpy
beforeEach(() => {
- markAllNoticesReadSpy = sinon.stub(background, 'markAllNoticesRead')
- markAllNoticesReadSpy.callsFake(cb => cb())
completeOnboardingSpy = sinon.stub(background, 'completeOnboarding')
completeOnboardingSpy.callsFake(cb => cb())
})
after(() => {
- markAllNoticesReadSpy.restore()
completeOnboardingSpy.restore()
})
- it('completing onboarding marks all notices as read', async () => {
+ it('completes onboarding', async () => {
const store = mockStore()
await store.dispatch(actions.setCompletedOnboarding())
- assert.equal(markAllNoticesReadSpy.callCount, 1)
assert.equal(completeOnboardingSpy.callCount, 1)
})
})
diff --git a/test/unit/ui/app/reducers/app.spec.js b/test/unit/ui/app/reducers/app.spec.js
index 6c77e0ef9..09cf3dbf0 100644
--- a/test/unit/ui/app/reducers/app.spec.js
+++ b/test/unit/ui/app/reducers/app.spec.js
@@ -445,15 +445,6 @@ describe('App State', () => {
assert.equal(state.forgottenPassword, false)
})
- it('shows notice', () => {
- const state = reduceApp(metamaskState, {
- type: actions.SHOW_NOTICE,
- })
-
- assert.equal(state.transForward, true)
- assert.equal(state.isLoading, false)
- })
-
it('reveals account', () => {
const state = reduceApp(metamaskState, {
type: actions.REVEAL_ACCOUNT,
diff --git a/test/unit/ui/app/reducers/metamask.spec.js b/test/unit/ui/app/reducers/metamask.spec.js
index 388c67c76..d7876bf39 100644
--- a/test/unit/ui/app/reducers/metamask.spec.js
+++ b/test/unit/ui/app/reducers/metamask.spec.js
@@ -35,49 +35,6 @@ describe('MetaMask Reducers', () => {
assert.equal(state.isRevealingSeedWords, false)
})
- it('shows notice', () => {
- const notice = {
- id: 0,
- read: false,
- date: 'Date',
- title: 'Title',
- body: 'Body',
- }
-
- const state = reduceMetamask({}, {
- type: actions.SHOW_NOTICE,
- value: notice,
- })
-
- assert.equal(state.noActiveNotices, false)
- assert.equal(state.nextUnreadNotice, notice)
- })
-
- it('clears notice', () => {
-
- const notice = {
- id: 0,
- read: false,
- date: 'Date',
- title: 'Title',
- body: 'Body',
- }
-
- const noticesState = {
- metamask: {
- noActiveNotices: false,
- nextUnreadNotice: notice,
- },
- }
-
- const state = reduceMetamask(noticesState, {
- type: actions.CLEAR_NOTICES,
- })
-
- assert.equal(state.noActiveNotices, true)
- assert.equal(state.nextUnreadNotice, null)
- })
-
it('unlocks MetaMask', () => {
const state = reduceMetamask({}, {
type: actions.UNLOCK_METAMASK,