1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-21 23:08:50 -05:00

Revert "[WO-878] Do not force import of private key for HKP keys"

This reverts commit 4fe3ceaea2.
This commit is contained in:
Tankred Hase 2015-02-10 14:36:30 +01:00
parent 7ffb7ca148
commit f8e5ea6d89
2 changed files with 7 additions and 25 deletions

View File

@ -51,7 +51,7 @@ var LoginCtrl = function($scope, $timeout, $location, updateHandler, account, au
});
});
} else if (availableKeys && availableKeys.publicKey && !availableKeys.publicKey.source && !availableKeys.privateKey) {
} else if (availableKeys && availableKeys.publicKey && !availableKeys.privateKey) {
// check if private key is synced
return keychain.requestPrivateKeyDownload({
userId: availableKeys.publicKey.userId,

View File

@ -86,7 +86,7 @@ describe('Login Controller unit test', function() {
authMock.getEmailAddress.returns(resolves({}));
scope.init().then(function() {
expect(goToStub.calledWith('/add-account')).to.be.true;
expect(goToStub.withArgs('/add-account').called).to.be.true;
expect(goToStub.calledOnce).to.be.true;
done();
});
@ -104,7 +104,7 @@ describe('Login Controller unit test', function() {
emailMock.unlock.returns(rejects(new Error()));
scope.init().then(function() {
expect(goToStub.calledWith('/login-existing')).to.be.true;
expect(goToStub.withArgs('/login-existing').called).to.be.true;
expect(goToStub.calledOnce).to.be.true;
expect(authMock.storeCredentials.called).to.be.false;
done();
@ -142,7 +142,7 @@ describe('Login Controller unit test', function() {
authMock.storeCredentials.returns(resolves());
scope.init().then(function() {
expect(goToStub.calledWith('/account')).to.be.true;
expect(goToStub.withArgs('/account').called).to.be.true;
expect(goToStub.calledOnce).to.be.true;
done();
});
@ -175,7 +175,7 @@ describe('Login Controller unit test', function() {
keychainMock.requestPrivateKeyDownload.returns(resolves(true));
scope.init().then(function() {
expect(goToStub.calledWith('/login-privatekey-download')).to.be.true;
expect(goToStub.withArgs('/login-privatekey-download').called).to.be.true;
expect(goToStub.calledOnce).to.be.true;
done();
});
@ -192,25 +192,7 @@ describe('Login Controller unit test', function() {
keychainMock.requestPrivateKeyDownload.returns(resolves());
scope.init().then(function() {
expect(goToStub.calledWith('/login-new-device')).to.be.true;
expect(goToStub.calledOnce).to.be.true;
done();
});
});
it('should redirect to /login-new-device', function(done) {
authMock.init.returns(resolves());
authMock.getEmailAddress.returns(resolves({
emailAddress: emailAddress
}));
accountMock.init.returns(resolves({
publicKey: {
source: 'foo'
}
}));
scope.init().then(function() {
expect(goToStub.calledWith('/login-initial')).to.be.true;
expect(goToStub.withArgs('/login-new-device').called).to.be.true;
expect(goToStub.calledOnce).to.be.true;
done();
});
@ -224,7 +206,7 @@ describe('Login Controller unit test', function() {
accountMock.init.returns(resolves({}));
scope.init().then(function() {
expect(goToStub.calledWith('/login-initial')).to.be.true;
expect(goToStub.withArgs('/login-initial').called).to.be.true;
expect(goToStub.calledOnce).to.be.true;
done();
});