diff options
author | Dan Finlay <somniac@me.com> | 2016-07-22 01:45:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-22 01:45:32 +0800 |
commit | 6658bea8d444281491718f8eee7bc3ae42f91b69 (patch) | |
tree | 1bfc13870221528af34df95e5f64f0d73b75aa16 /test | |
parent | cdd7e40545af8e62fc586f8da120e8d05ca90653 (diff) | |
download | tangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.tar.gz tangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.tar.zst tangerine-wallet-browser-6658bea8d444281491718f8eee7bc3ae42f91b69.zip |
Implement some cross-browser practices (#473)
* Add mozilla plugin key to manifest
* Move all chrome references into platform-checking module
Addresses #453
* Add chrome global back to linter blacklist
* Add tests
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/extension-test.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/unit/extension-test.js b/test/unit/extension-test.js new file mode 100644 index 000000000..0a03a3b97 --- /dev/null +++ b/test/unit/extension-test.js @@ -0,0 +1,39 @@ +var assert = require('assert') +var sinon = require('sinon') +const ethUtil = require('ethereumjs-util') + +var path = require('path') +var Extension = require(path.join(__dirname, '..', '..', 'app', 'scripts', 'lib', 'extension-instance.js')) + +describe('extension', function() { + + describe('with chrome global', function() { + let extension + + beforeEach(function() { + window.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 + + beforeEach(function() { + window.chrome = undefined + window.alarms = 'foo' + extension = new Extension() + }) + + it('should use the global apis', function() { + assert.equal(extension.alarms, 'foo') + }) + }) + +}) |