aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/BrowserTestExtension/tests/decryptTest.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-08-22 16:37:46 +0000
committerMaximilian Krambach <[email protected]>2018-08-22 16:37:46 +0000
commitf0409bbdafcbd4f8b0be099a6b3ce0d5352c9bcd (patch)
treefc94d23b0abef3c9e7c73d8a0165262f16e575e7 /lang/js/BrowserTestExtension/tests/decryptTest.js
parentjs: improve decryption performance (diff)
downloadgpgme-f0409bbdafcbd4f8b0be099a6b3ce0d5352c9bcd.tar.gz
gpgme-f0409bbdafcbd4f8b0be099a6b3ce0d5352c9bcd.zip
js: make method parameters objects
-- * As requested by using parties, the options to be passed into the methods are now objects, with the objects' properties better describing what they do, and to avoid the need to type several nulls in a method call if one wants the last parameter. - src/Keyring.js, src/gpgme.js: Changed parameters and their validations - BrowserTest/*.js Had to adapt quite some calls to the new format
Diffstat (limited to 'lang/js/BrowserTestExtension/tests/decryptTest.js')
-rw-r--r--lang/js/BrowserTestExtension/tests/decryptTest.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/lang/js/BrowserTestExtension/tests/decryptTest.js b/lang/js/BrowserTestExtension/tests/decryptTest.js
index ea887491..8852cb6a 100644
--- a/lang/js/BrowserTestExtension/tests/decryptTest.js
+++ b/lang/js/BrowserTestExtension/tests/decryptTest.js
@@ -38,7 +38,7 @@ describe('Decryption', function () {
it('Decryption of random string fails', function (done) {
let data = bigString(20 * 1024);
- context.decrypt(data).then(
+ context.decrypt({ data: data }).then(
function (){},
function (error){
expect(error).to.be.an('error');
@@ -49,21 +49,22 @@ describe('Decryption', function () {
it('Decryption of slightly corrupted message fails', function (done) {
const data = bigString(10000);
- context.encrypt(data, good_fpr).then(function (enc){
- context.decrypt(sabotageMsg(enc.data)).then(
- function (){},
- function (error){
- expect(error).to.be.an('error');
- expect(error.code).to.equal('GNUPG_ERROR');
- done();
- });
- });
+ context.encrypt({ data: data, publicKeys:good_fpr }).then(
+ function (enc){
+ context.decrypt({ data: sabotageMsg(enc.data) }).then(
+ function (){},
+ function (error){
+ expect(error).to.be.an('error');
+ expect(error.code).to.equal('GNUPG_ERROR');
+ done();
+ });
+ });
}).timeout(5000);
it('decrypt/verify operations return proper information', function (done){
const data = inputvalues.encryptSignedMessage;
- context.decrypt(data).then(function (result){
+ context.decrypt({ data: data }).then(function (result){
expect(result).to.be.an('object');
expect(result.signatures).to.be.an('object');
expect(result.signatures.all_valid).to.be.true;