user3428816
user3428816

Reputation: 1301

How to check click event is triggered or not in Jasmine framework?

I have developed Backbone application with some click events and I am applying some CSS attributes to the DIV elements dynamically.

When I am writing test cases using Jasmine Framework, I want to know the click event is triggered or not.

If it is triggered, I want to confirm from Jasmine whether new CSS attributes has been applied or not.

How to check? I have already tried this answer: https://stackoverflow.com/a/23492830/3428816

and

http://www.htmlgoodies.com/beyond/javascript/js-ref/testing-dom-events-using-jquery-and-jasmine-2.0.html

Please help me

Upvotes: 0

Views: 3079

Answers (1)

KumarA
KumarA

Reputation: 1378

The answer from this link: https://stackoverflow.com/a/23492830/3428816 is correct.

I hope you are expecting real time click event will happen when you are triggering click event in Jasmine.

Event will not triggered in real. You can cover the code Whether event is triggering or not using Jasmine.

I hope this helps to understand the Jasmine event triggering.

Upvotes: 1

Related Questions