aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/BrowserTestExtension/tests/KeyImportExport.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-07-24 12:56:33 +0000
committerMaximilian Krambach <[email protected]>2018-07-24 12:56:33 +0000
commit4b343c4e339862a5faf8dd20590a3c4592fb6abb (patch)
tree8fb9eb1e9a7414f17979f7af30bd6860ad0a3a18 /lang/js/BrowserTestExtension/tests/KeyImportExport.js
parentjs: Fix wrong encoding in received error messages (diff)
downloadgpgme-4b343c4e339862a5faf8dd20590a3c4592fb6abb.tar.gz
gpgme-4b343c4e339862a5faf8dd20590a3c4592fb6abb.zip
js: include armored Key in import callback
-- * The import answer now also directly contains the armored Key as Key property, without need to refresh the Key object created in the answer. This allows for direct comparision of input and output. * BrowserTestExtension: added test for that import callback
Diffstat (limited to 'lang/js/BrowserTestExtension/tests/KeyImportExport.js')
-rw-r--r--lang/js/BrowserTestExtension/tests/KeyImportExport.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/lang/js/BrowserTestExtension/tests/KeyImportExport.js b/lang/js/BrowserTestExtension/tests/KeyImportExport.js
index 4a53c7a6..ed307b32 100644
--- a/lang/js/BrowserTestExtension/tests/KeyImportExport.js
+++ b/lang/js/BrowserTestExtension/tests/KeyImportExport.js
@@ -83,6 +83,32 @@ describe('Key importing', function () {
});
});
});
+
+ it('Import result feedback', function(done){
+ let prm = Gpgmejs.init();
+ prm.then(function (context) {
+ context.Keyring.getKeys(ImportablePublicKey.fingerprint).then(
+ function(result){
+ expect(result).to.be.an('array');
+ expect(result.length).to.equal(0);
+ context.Keyring.importKey(ImportablePublicKey.key, true)
+ .then(function(result){
+ expect(result).to.be.an('object');
+ expect(result.Keys[0]).to.be.an('object');
+ expect(result.Keys[0].key.fingerprint).to.equal(
+ ImportablePublicKey.fingerprint);
+ expect(result.Keys[0].status).to.equal('newkey');
+ result.Keys[0].key.getArmor().then(function(armor){
+ expect(armor).to.be.a('string');
+ result.Keys[0].key.delete().then(function(){
+ done();
+ });
+ });
+ });
+ });
+ });
+ });
+
it('exporting armored Key with getKeysArmored', function (done) {
let prm = Gpgmejs.init();
const fpr = inputvalues.encrypt.good.fingerprint;