mirror of
https://github.com/moparisthebest/mail
synced 2025-01-31 07:00:17 -05:00
[WO-183] key file export now proposes file name whiteout_mail_foo@bar.com_KEYIDKEYID.asc
This commit is contained in:
parent
8f366ffb75
commit
7d0fc373ab
@ -41,7 +41,7 @@ define(function(require) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var id = keys.keyId.substring(8, keys.keyId.length);
|
var id = 'whiteout_mail_' + emailDao._account.emailAddress + '_' + keys.keyId.substring(8, keys.keyId.length);
|
||||||
dl.createDownload({
|
dl.createDownload({
|
||||||
content: keys.publicKeyArmored + keys.privateKeyArmored,
|
content: keys.publicKeyArmored + keys.privateKeyArmored,
|
||||||
filename: id + '.asc',
|
filename: id + '.asc',
|
||||||
|
@ -61,7 +61,7 @@ define(function(require) {
|
|||||||
var id = keys.keyId.substring(8, keys.keyId.length);
|
var id = keys.keyId.substring(8, keys.keyId.length);
|
||||||
dl.createDownload({
|
dl.createDownload({
|
||||||
content: keys.publicKeyArmored + keys.privateKeyArmored,
|
content: keys.publicKeyArmored + keys.privateKeyArmored,
|
||||||
filename: id + '.asc',
|
filename: 'whiteout_mail_' + emailDao._account.emailAddress + '_' + id + '.asc',
|
||||||
contentType: 'text/plain'
|
contentType: 'text/plain'
|
||||||
}, onSave);
|
}, onSave);
|
||||||
});
|
});
|
||||||
|
@ -71,7 +71,7 @@ define(function(require) {
|
|||||||
keyId: dummyKeyId
|
keyId: dummyKeyId
|
||||||
});
|
});
|
||||||
createDownloadMock.withArgs(sinon.match(function(arg) {
|
createDownloadMock.withArgs(sinon.match(function(arg) {
|
||||||
return arg.content === 'ab' && arg.filename === expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
return arg.content === 'ab' && arg.filename === 'whiteout_mail_' + emailAddress + '_' + expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
||||||
})).yields();
|
})).yields();
|
||||||
scope.onError = function() {
|
scope.onError = function() {
|
||||||
expect(cryptoMock.exportKeys.calledOnce).to.be.true;
|
expect(cryptoMock.exportKeys.calledOnce).to.be.true;
|
||||||
@ -100,9 +100,7 @@ define(function(require) {
|
|||||||
privateKeyArmored: 'b',
|
privateKeyArmored: 'b',
|
||||||
keyId: dummyKeyId
|
keyId: dummyKeyId
|
||||||
});
|
});
|
||||||
createDownloadMock.withArgs(sinon.match(function(arg) {
|
createDownloadMock.withArgs().yields(new Error('asdasd'));
|
||||||
return arg.content === 'ab' && arg.filename === expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
|
||||||
})).yields(new Error('asdasd'));
|
|
||||||
scope.onError = function() {
|
scope.onError = function() {
|
||||||
expect(cryptoMock.exportKeys.calledOnce).to.be.true;
|
expect(cryptoMock.exportKeys.calledOnce).to.be.true;
|
||||||
expect(dl.createDownload.calledOnce).to.be.true;
|
expect(dl.createDownload.calledOnce).to.be.true;
|
||||||
|
@ -133,7 +133,7 @@ define(function(require) {
|
|||||||
keyId: keyId
|
keyId: keyId
|
||||||
});
|
});
|
||||||
createDownloadMock.withArgs(sinon.match(function(arg) {
|
createDownloadMock.withArgs(sinon.match(function(arg) {
|
||||||
return arg.content === 'ab' && arg.filename === expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
return arg.content === 'ab' && arg.filename === 'whiteout_mail_' + emailAddress + '_' + expectedKeyId + '.asc' && arg.contentType === 'text/plain';
|
||||||
})).yields();
|
})).yields();
|
||||||
|
|
||||||
locationSpy = sinon.spy(location, 'path');
|
locationSpy = sinon.spy(location, 'path');
|
||||||
|
Loading…
Reference in New Issue
Block a user