aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-03-31 10:05:11 +0800
committerkumavis <aaron@kumavis.me>2017-03-31 10:05:11 +0800
commitbd704b1d7e7208fe1989bd7dde6ab81cb39bbfcc (patch)
treeb217f4b5353ed21169a33603e4690a6d7da4b289
parentf9e09d23002c38bc441e5216304883ccb1c3d6df (diff)
downloadtangerine-wallet-browser-bd704b1d7e7208fe1989bd7dde6ab81cb39bbfcc.tar.gz
tangerine-wallet-browser-bd704b1d7e7208fe1989bd7dde6ab81cb39bbfcc.tar.zst
tangerine-wallet-browser-bd704b1d7e7208fe1989bd7dde6ab81cb39bbfcc.zip
etc - fix notification-manager ref, remove duplicated test file
-rw-r--r--test/unit/extension-test.js77
-rw-r--r--ui/app/reducers/app.js6
2 files changed, 4 insertions, 79 deletions
diff --git a/test/unit/extension-test.js b/test/unit/extension-test.js
deleted file mode 100644
index 8f259f05c..000000000
--- a/test/unit/extension-test.js
+++ /dev/null
@@ -1,77 +0,0 @@
-var assert = require('assert')
-var sinon = require('sinon')
-const ethUtil = require('ethereumjs-util')
-global.chrome = {}
-global.browser = {}
-
-var path = require('path')
-var Extension = require(path.join(__dirname, '..', '..', 'app', 'scripts', 'lib', 'extension-instance.js'))
-
-describe('extension', function() {
-
- describe('extension.getURL', function() {
- const desiredResult = 'http://the-desired-result.io'
-
- describe('in Chrome or Firefox', function() {
- global.chrome.extension = {
- getURL: () => desiredResult
- }
-
- it('returns the desired result', function() {
- const extension = new Extension()
- const result = extension.extension.getURL()
- assert.equal(result, desiredResult)
- })
- })
-
- describe('in Microsoft Edge', function() {
- global.browser.extension = {
- getURL: () => desiredResult
- }
-
- it('returns the desired result', function() {
- const extension = new Extension()
- const result = extension.extension.getURL()
- assert.equal(result, desiredResult)
- })
- })
- })
-
- describe('with chrome global', function() {
- let extension
-
- beforeEach(function() {
- global.chrome = {
- alarms: 'foo'
- }
- extension = new Extension()
- })
-
- it('should use the chrome global apis', function() {
- assert.equal(extension.alarms, 'foo')
- })
- })
-
- describe('without chrome global', function() {
- let extension
- let realWindow
-
- beforeEach(function() {
- realWindow = window
- window = global
- global.chrome = undefined
- global.alarms = 'foo'
- extension = new Extension()
- })
-
- after(function() {
- window = realWindow
- })
-
- it('should use the global apis', function() {
- assert.equal(extension.alarms, 'foo')
- })
- })
-
-
-})
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index 6f633ab4e..7595c60b3 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -1,7 +1,9 @@
const extend = require('xtend')
const actions = require('../actions')
const txHelper = require('../../lib/tx-helper')
-const notification = require('../../../app/scripts/lib/notification-manager')
+const NotificationManager = require('../../../app/scripts/lib/notification-manager')
+
+const notificationManager = new NotificationManager()
module.exports = reduceApp
@@ -332,7 +334,7 @@ function reduceApp (state, action) {
})
} else {
log.debug('attempting to close popup')
- notification.closePopup()
+ notificationManager.closePopup()
return extend(appState, {
transForward: false,