diff options
Diffstat (limited to 'lang/js/BrowserTestExtension')
-rw-r--r-- | lang/js/BrowserTestExtension/browsertest.html | 2 | ||||
-rw-r--r-- | lang/js/BrowserTestExtension/runbrowsertest.js | 1 | ||||
-rw-r--r-- | lang/js/BrowserTestExtension/tests/encryptTest.js | 14 |
3 files changed, 6 insertions, 11 deletions
diff --git a/lang/js/BrowserTestExtension/browsertest.html b/lang/js/BrowserTestExtension/browsertest.html index d2c6396f..ce037a11 100644 --- a/lang/js/BrowserTestExtension/browsertest.html +++ b/lang/js/BrowserTestExtension/browsertest.html @@ -14,9 +14,11 @@ <script src="libs/gpgmejs.bundle.js"></script> <script src="tests/inputvalues.js"></script> + <script src="libs/gpgmejs_unittests.bundle.js"></script> <!-- insert tests here--> <script src="tests/startup.js"></script> <script src="tests/encryptTest.js"></script> + <!-- run tests --> <script src="runbrowsertest.js"></script> </body> diff --git a/lang/js/BrowserTestExtension/runbrowsertest.js b/lang/js/BrowserTestExtension/runbrowsertest.js index 39bc3fb9..308c716d 100644 --- a/lang/js/BrowserTestExtension/runbrowsertest.js +++ b/lang/js/BrowserTestExtension/runbrowsertest.js @@ -19,3 +19,4 @@ */ mocha.run(); +Gpgmejs_test.unittests(); diff --git a/lang/js/BrowserTestExtension/tests/encryptTest.js b/lang/js/BrowserTestExtension/tests/encryptTest.js index e6000003..2178efac 100644 --- a/lang/js/BrowserTestExtension/tests/encryptTest.js +++ b/lang/js/BrowserTestExtension/tests/encryptTest.js @@ -18,8 +18,7 @@ * SPDX-License-Identifier: LGPL-2.1+ */ describe('Encryption', function(){ - - it('Successfull encrypt', function(done){ + it('Successfull encrypt', function(){ let prm = Gpgmejs.init(); prm.then(function(context){ context.encrypt( @@ -29,10 +28,6 @@ describe('Encryption', function(){ expect(answer.data).to.be.a("string"); expect(answer.data).to.include('BEGIN PGP MESSAGE'); expect(answer.data).to.include('END PGP MESSAGE'); - done(); - }, function(err){ - expect(err).to.be.undefined; - done(); }); }); }); @@ -44,11 +39,10 @@ describe('Encryption', function(){ inputvalues.encrypt.good.data, null).then(function(answer){ expect(answer).to.be.undefined; - done(); }, function(error){ expect(error).to.be.an('Error'); expect(error.code).to.equal('MSG_INCOMPLETE'); - done() + //TODO: MSG_INCOMPLETE desired, GNUPG_ERROR coming }); }); }); @@ -61,11 +55,9 @@ describe('Encryption', function(){ expect(answer).to.be.undefined; }, function(error){ expect(error).to.be.an.instanceof(Error); - expect(error.code).to.equal('MSG_INCOMPLETE'); - done(); + expect(error.code).to.equal('PARAM_WRONG'); }); }); }); - // TODO check different valid parameter }); |