diff options
author | Maximilian Krambach <[email protected]> | 2018-05-07 16:27:25 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-05-07 16:27:25 +0000 |
commit | 8f3d83e5f0903323ec92f588f60dcecb0ae96de4 (patch) | |
tree | 65620180493539aacb6f5368a06f3ba63da19d96 /lang/js/unittests.js | |
parent | js: fixing errors found by testing (diff) | |
download | gpgme-8f3d83e5f0903323ec92f588f60dcecb0ae96de4.tar.gz gpgme-8f3d83e5f0903323ec92f588f60dcecb0ae96de4.zip |
js: fixing errors found by testing: encrypt/decrypt
--
* Key.js: Error code for wrong parameter in createKey should be
"PARAM_WRONG"
* Helpers.js: The property openpgpjs-like Objects were checked for in
toKeyIdArray was not defined.
* src/permittedOperations.js: updated more expectations and assumptions
for the native API
* new Problems:
- There seems to be a message size limit of about 21 MB for
nativeMessaging, much lower than the documented 4GB.
- Some bytes are lost with random data in an encrypt-decrypt
roundtrip. The culprit is unclear.
Diffstat (limited to 'lang/js/unittests.js')
-rw-r--r-- | lang/js/unittests.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lang/js/unittests.js b/lang/js/unittests.js index 6c0d1890..c437d599 100644 --- a/lang/js/unittests.js +++ b/lang/js/unittests.js @@ -130,7 +130,6 @@ function unittests (){ let test0 = toKeyIdArray(hp.valid_openpgplike); expect(test0).to.be.an('array').with.lengthOf(1); - console.log(test0); expect(test0).to.include( hp.valid_openpgplike.primaryKey.getFingerprint()); }); @@ -255,7 +254,7 @@ function unittests (){ expect(test0.isComplete).to.be.false; }); - it('Message is complete after setting mandatoy data', function(){ + it('Message is complete after setting mandatory data', function(){ let test0 = createMessage('encrypt'); test0.setParameter('data', mp.valid_encrypt_data); test0.setParameter('keys', hp.validFingerprints); @@ -263,6 +262,13 @@ function unittests (){ expect(test0.isComplete).to.be.true; }); + it('Message is not complete after mandatory data is empty', function(){ + let test0 = createMessage('encrypt'); + test0.setParameter('data', ''); + test0.setParameter('keys', hp.validFingerprints); + expect(test0.isComplete).to.be.false; + }); + it('Complete Message contains the data that was set', function(){ let test0 = createMessage('encrypt'); test0.setParameter('data', mp.valid_encrypt_data); @@ -315,7 +321,6 @@ function unittests (){ }); }); - mocha.run(); } export default {unittests};
\ No newline at end of file |