mirror of
https://github.com/moparisthebest/mail
synced 2024-12-21 23:08:50 -05:00
Hide error msg if public key verification does nto work
This commit is contained in:
parent
9841a59a9e
commit
d0f002bfd1
@ -30,7 +30,7 @@ var PublicKeyVerifierCtrl = function($scope, $location, $q, $timeout, $interval,
|
||||
return success();
|
||||
|
||||
}).catch(function(error) {
|
||||
$scope.errMsg = error.message + ' Retrying in ' + RETRY_INTERVAL / 1000 + ' seconds...'; // display error
|
||||
$scope.errMsg = error.message; // display error
|
||||
|
||||
scheduleVerification(); // schedule next verification attempt
|
||||
});
|
||||
|
@ -95,7 +95,7 @@ PublickeyVerifier.prototype.verify = function() {
|
||||
|
||||
if (!verificationSuccessful) {
|
||||
// nothing unexpected went wrong, but no public key could be verified
|
||||
throw new Error('Could not verify public key.');
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
resolve(); // we're done
|
||||
|
@ -94,6 +94,26 @@ describe('Public Key Verification Controller unit test', function() {
|
||||
it('should not verify', function(done) {
|
||||
var credentials = {};
|
||||
|
||||
auth.getCredentials.returns(resolves(credentials));
|
||||
verifier.configure.withArgs(credentials).returns(resolves());
|
||||
verifier.verify.withArgs().returns(rejects(new Error()));
|
||||
|
||||
scope.verify().then(function() {
|
||||
expect(auth.getCredentials.calledOnce).to.be.true;
|
||||
expect(verifier.configure.calledOnce).to.be.true;
|
||||
expect(verifier.verify.calledOnce).to.be.true;
|
||||
expect(scope.errMsg).to.equal('');
|
||||
|
||||
clearTimeout(scope.timeout);
|
||||
clearInterval(scope.countdownDecrement);
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not verify with error message', function(done) {
|
||||
var credentials = {};
|
||||
|
||||
auth.getCredentials.returns(resolves(credentials));
|
||||
verifier.configure.withArgs(credentials).returns(resolves());
|
||||
verifier.verify.withArgs().returns(rejects(new Error('foo')));
|
||||
|
@ -191,7 +191,7 @@ describe('Public-Key Verifier', function() {
|
||||
|
||||
// run the test
|
||||
verifier.verify().catch(function(error) {
|
||||
expect(error.message).to.equal('Could not verify public key');
|
||||
expect(error.message).to.equal('');
|
||||
|
||||
// verification
|
||||
expect(imapStub.login.callCount).to.equal(1);
|
||||
|
Loading…
Reference in New Issue
Block a user