Ejemplo n.º 1
0
    beforeEach(function(done) {
      deauthenticationError = new Error('Something bad happened');
      userData.unauthenticateCurrentUser.returns(Promise.reject(deauthenticationError));
      this.sinon.stub(console, 'error');

      link.click();
      expect(userData.unauthenticateCurrentUser, 'tries to deauthenticate').to.have.been.called;

      Promise.nextTick().then(done);
    });
Ejemplo n.º 2
0
    it('asks userData to send the password recovery email', function(done) {
      passwordRecoveryForm
      .submit({
        'email': email
      })
      .catch(done);

      Promise.nextTick().then(function() {
        expect(userData.sendPasswordRecoveryEmail).to.have.been.calledWith(email);
        done();
      });
    });
Ejemplo n.º 3
0
      it('hides any previous validation error message', function(done) {
        formValidationError.show('Something’s not valid');

        passwordRecoveryForm
        .submit({
          'email': email
        })
        .catch(done);

        Promise.nextTick().then(function() {
          expect(formValidationError.isShown()).to.be.false;
          done();
        });
      });
Ejemplo n.º 4
0
 beforeEach(function(done) {
   submitForm();
   userServiceRequest.simulateFailure();
   Promise.nextTick().then(done);
 });
Ejemplo n.º 5
0
 function initPage() {
   new ClientListPage(domElement, userData);
   return Promise.nextTick();
 }