aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/unittests.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-07-27 18:36:21 +0000
committerMaximilian Krambach <[email protected]>2018-07-27 18:36:21 +0000
commit94ee0988d4eaac27785de6efb7c19ca9976e1e9c (patch)
treeb9a06e35d1a2831cb0750177daa978314b9be481 /lang/js/unittests.js
parentjs: clean up test extension (diff)
downloadgpgme-94ee0988d4eaac27785de6efb7c19ca9976e1e9c.tar.gz
gpgme-94ee0988d4eaac27785de6efb7c19ca9976e1e9c.zip
js: change the write access for js class methods
-- * src/ [Connection, Error, Key, Keyring, MEssage, Signature, gpgmejs]: Functions and values that are not meant to be overwritten are now moved into their constructors, thus eliminating the possibility of overwrites after initialization. * Key: The mode of use (synchronous cached, or async promises) ivs now determined at initialization of that Key. The property Key.isAsync reflects this state. * unittests: fixed old Key syntax for testing. * Message.js isComplete is now a method and not a getter anymore. * Added some startup tests.
Diffstat (limited to 'lang/js/unittests.js')
-rw-r--r--lang/js/unittests.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/lang/js/unittests.js b/lang/js/unittests.js
index 04e15ef3..6228993b 100644
--- a/lang/js/unittests.js
+++ b/lang/js/unittests.js
@@ -194,16 +194,16 @@ function unittests (){
});
it('Non-cached key async data retrieval', function (done){
- let key = createKey(kp.validKeyFingerprint);
- key.get('can_authenticate',false).then(function(result){
+ let key = createKey(kp.validKeyFingerprint, true);
+ key.get('can_authenticate').then(function(result){
expect(result).to.be.a('boolean');
done();
});
});
it('Non-cached key async armored Key', function (done){
- let key = createKey(kp.validKeyFingerprint);
- key.get('armored', false).then(function(result){
+ let key = createKey(kp.validKeyFingerprint, true);
+ key.get('armored').then(function(result){
expect(result).to.be.a('string');
expect(result).to.include('KEY BLOCK-----');
done();
@@ -211,17 +211,17 @@ function unittests (){
});
it('Non-cached key async hasSecret', function (done){
- let key = createKey(kp.validKeyFingerprint);
- key.get('hasSecret', false).then(function(result){
+ let key = createKey(kp.validKeyFingerprint, true);
+ key.get('hasSecret').then(function(result){
expect(result).to.be.a('boolean');
done();
});
});
it('Non-cached key async hasSecret (no secret in Key)', function (done){
- let key = createKey(kp.validFingerprintNoSecret);
+ let key = createKey(kp.validFingerprintNoSecret, true);
expect(key).to.be.an.instanceof(GPGME_Key);
- key.get('hasSecret', false).then(function(result){
+ key.get('hasSecret').then(function(result){
expect(result).to.be.a('boolean');
expect(result).to.equal(false);
done();
@@ -317,7 +317,7 @@ function unittests (){
let test0 = createMessage('encrypt');
expect(test0).to.be.an.instanceof(GPGME_Message);
- expect(test0.isComplete).to.be.false;
+ expect(test0.isComplete()).to.be.false;
});
it('Message is complete after setting mandatory data', function(){
@@ -325,14 +325,14 @@ function unittests (){
test0.setParameter('data', mp.valid_encrypt_data);
test0.setParameter('keys', hp.validFingerprints);
- expect(test0.isComplete).to.be.true;
+ 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;
+ expect(test0.isComplete()).to.be.false;
});
it('Complete Message contains the data that was set', function(){