Timeout not working in AngularJS Karma program - Jasmine
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 will timeout after the first click. However, this doesn't work. Anyone have an idea?
+3
source to share