Fix browser tests
This commit is contained in:
parent
454ca1d879
commit
6b4d44dbb1
|
@ -345,7 +345,7 @@ export function verify({ message, publicKeys, signature=null, date=new Date() })
|
|||
publicKeys = toArray(publicKeys);
|
||||
|
||||
if (asyncProxy) { // use web worker if available
|
||||
return asyncProxy.delegate('verify', { message, publicKeys, signature });
|
||||
return asyncProxy.delegate('verify', { message, publicKeys, signature, date });
|
||||
}
|
||||
|
||||
return Promise.resolve().then(async function() {
|
||||
|
|
|
@ -60,7 +60,7 @@ export function clonePackets(options) {
|
|||
if (options.message instanceof Message) {
|
||||
options.message = options.message.packets;
|
||||
} else if (options.message instanceof CleartextMessage) {
|
||||
options.message.signature = options.message.signature.packets;
|
||||
options.message = { text: options.message.text, signature: options.message.signature.packets };
|
||||
}
|
||||
}
|
||||
if (options.signature && (options.signature instanceof Signature)) {
|
||||
|
|
|
@ -868,7 +868,12 @@ describe('OpenPGP.js public api tests', function() {
|
|||
|
||||
beforeEach(function (done) {
|
||||
expect(privateKey.keys[0].decrypt(passphrase)).to.be.true;
|
||||
privateKey.keys[0].verifyPrimaryUser().then(() => done());
|
||||
Promise.all([
|
||||
privateKey.keys[0].verifyPrimaryUser(),
|
||||
privateKey_2000_2008.keys[0].verifyPrimaryUser(),
|
||||
privateKey_1337.keys[0].verifyPrimaryUser(),
|
||||
privateKey_2038_2045.keys[0].verifyPrimaryUser()
|
||||
]).then(() => done());
|
||||
});
|
||||
|
||||
it('should encrypt then decrypt', function () {
|
||||
|
@ -1572,7 +1577,7 @@ describe('OpenPGP.js public api tests', function() {
|
|||
return openpgp.verify(verifyOpt);
|
||||
}).then(function (verified) {
|
||||
expect(+verified.signatures[0].signature.packets[0].created).to.equal(+future);
|
||||
expect(verified.data).to.equal(data);
|
||||
expect(Array.from(verified.data)).to.deep.equal(Array.from(data));
|
||||
expect(verified.signatures[0].valid).to.be.true;
|
||||
expect(signOpt.privateKeys[0].getSigningKeyPacket(verified.signatures[0].keyid, future))
|
||||
.to.be.not.null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user