aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ui/app/actions.spec.js
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2019-04-09 02:35:58 +0800
committerGitHub <noreply@github.com>2019-04-09 02:35:58 +0800
commit8c98e89e617b594d4f0ee54a8437e30201688090 (patch)
treee920376b663e7df57e999935c23a448b71bb279d /test/unit/ui/app/actions.spec.js
parent87f393eb31c5172a246db6be37331f8bed9d096e (diff)
parent79804ec79bda1cffa530743ddb8d299c257092a2 (diff)
downloadtangerine-wallet-browser-8c98e89e617b594d4f0ee54a8437e30201688090.tar.gz
tangerine-wallet-browser-8c98e89e617b594d4f0ee54a8437e30201688090.tar.zst
tangerine-wallet-browser-8c98e89e617b594d4f0ee54a8437e30201688090.zip
Merge pull request #6419 from MetaMask/develop
Merge develop into master
Diffstat (limited to 'test/unit/ui/app/actions.spec.js')
-rw-r--r--test/unit/ui/app/actions.spec.js54
1 files changed, 2 insertions, 52 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)
})
})