|
Packit Service |
30b792 |
/* gpgme.js - Javascript integration for gpgme
|
|
Packit Service |
30b792 |
* Copyright (C) 2018 Bundesamt für Sicherheit in der Informationstechnik
|
|
Packit Service |
30b792 |
*
|
|
Packit Service |
30b792 |
* This file is part of GPGME.
|
|
Packit Service |
30b792 |
*
|
|
Packit Service |
30b792 |
* GPGME is free software; you can redistribute it and/or modify it
|
|
Packit Service |
30b792 |
* under the terms of the GNU Lesser General Public License as
|
|
Packit Service |
30b792 |
* published by the Free Software Foundation; either version 2.1 of
|
|
Packit Service |
30b792 |
* the License, or (at your option) any later version.
|
|
Packit Service |
30b792 |
*
|
|
Packit Service |
30b792 |
* GPGME is distributed in the hope that it will be useful, but
|
|
Packit Service |
30b792 |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
30b792 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
30b792 |
* Lesser General Public License for more details.
|
|
Packit Service |
30b792 |
*
|
|
Packit Service |
30b792 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
30b792 |
* License along with this program; if not, see <https://www.gnu.org/licenses/>.
|
|
Packit Service |
30b792 |
* SPDX-License-Identifier: LGPL-2.1+
|
|
Packit Service |
30b792 |
*
|
|
Packit Service |
30b792 |
* Author(s):
|
|
Packit Service |
30b792 |
* Maximilian Krambach <mkrambach@intevation.de>
|
|
Packit Service |
30b792 |
*/
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
/* global describe, it, expect, Gpgmejs, inputvalues */
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
describe('GPGME context', function (){
|
|
Packit Service |
30b792 |
it('Starting a GpgME instance', function (done){
|
|
Packit Service |
30b792 |
let prm = Gpgmejs.init({ timeout: 2000 });
|
|
Packit Service |
30b792 |
const input = inputvalues.someInputParameter;
|
|
Packit Service |
30b792 |
prm.then(
|
|
Packit Service |
30b792 |
function (context){
|
|
Packit Service |
30b792 |
expect(context).to.be.an('object');
|
|
Packit Service |
30b792 |
expect(context.encrypt).to.be.a('function');
|
|
Packit Service |
30b792 |
expect(context.decrypt).to.be.a('function');
|
|
Packit Service |
30b792 |
expect(context.sign).to.be.a('function');
|
|
Packit Service |
30b792 |
expect(context.verify).to.be.a('function');
|
|
Packit Service |
30b792 |
context.Keyring = input;
|
|
Packit Service |
30b792 |
expect(context.Keyring).to.be.an('object');
|
|
Packit Service |
30b792 |
expect(context.Keyring).to.not.equal(input);
|
|
Packit Service |
30b792 |
expect(context.Keyring.getKeys).to.be.a('function');
|
|
Packit Service |
30b792 |
expect(context.Keyring.getDefaultKey).to.be.a('function');
|
|
Packit Service |
30b792 |
expect(context.Keyring.importKey).to.be.a('function');
|
|
Packit Service |
30b792 |
expect(context.Keyring.generateKey).to.be.a('function');
|
|
Packit Service |
30b792 |
done();
|
|
Packit Service |
30b792 |
});
|
|
Packit Service |
30b792 |
});
|
|
Packit Service |
30b792 |
});
|