jeudi 4 juin 2015

Timeout does not work in AngularJS Karma - Jasmine test

My code:

describe('Popup', function(){

it("Should close on second click", function(){
        compileDirective(400,'click','true');  
            element.triggerHandler('click');
            timeout(function() {
                 element.triggerHandler('click');
                 scope.$digest();
                 timeout.flush();
                 element.remove();
                 $(".sidepopright").remove();
             }, 1000);

        });

});

I want to make a delay for the second click of the popup, so I put a timeout after the first click. However, it does not work. Anyone have idea?

Aucun commentaire:

Enregistrer un commentaire